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

Module: Website Membership Gamification

Entity: res.partner

Compute Method: _compute_gamification_badge_ids

Inputs Method Outputs
  • user_ids
  • commercial_partner_id
for sel in self:
            sel.gamification_badge_ids = (
                sel.user_ids.mapped("badge_ids") if sel.user_ids else False
            )
            if sel.user_ids and sel != sel.commercial_partner_id:
                badges = [
                    Command.link(badge)
                    for badge in sel.user_ids.mapped("badge_ids").ids
                ]
                sel.commercial_partner_id.gamification_badge_ids = badges

Back to entity