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

Module: Website

Entity: website.visitor

Compute Method: _compute_partner_id

Inputs Method Outputs
for visitor in self:
            if not visitor.id:
                visitor.partner_id = visitor._origin.partner_id
                continue
            # If the access_token is not a 32 length hexa string, it means that
            # the visitor is linked to a logged in user, in which case its
            # partner_id is used instead as the token.
            partner_id = len(visitor.access_token) != 32 and int(visitor.access_token)
            visitor.partner_id = self.env['res.partner'].browse(partner_id)

Back to entity