Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Base

Entity: res.device

Compute Method: _compute_is_current

Inputs Method Outputs
if not request or not hasattr(request, 'httprequest'):
            self.is_current = False
            return
session_identifier = request.session.sid[:STORED_SESSION_BYTES]
ip_address = collapse_ip_address(request.httprequest.remote_addr)
user_agent = request.httprequest.user_agent.string
for device in self:
            device.is_current = \
                device.session_identifier == session_identifier and \
                device.ip_address == ip_address and \
                device.user_agent == user_agent

Back to entity