Search code examples
pythonodoouser-agentodoo-8

Odoo - get user agent string in backend?


For some functionality in backend of Odoo, I need to use user agent information that is extracted from browser. Is there some simple way to access that through some of Odoo methods or so?


Solution

  • Found how to get it:

    from openerp.http import request
    ua = request.httprequest.environ.get('HTTP_USER_AGENT', '')
    

    Note. httprequest seems to be deprecated. But for now I din't find another way to get user agent.