diff --git a/sale_commission_salesman/models/account_move.py b/sale_commission_salesman/models/account_move.py index ea33b7203..0e90dedeb 100644 --- a/sale_commission_salesman/models/account_move.py +++ b/sale_commission_salesman/models/account_move.py @@ -18,7 +18,7 @@ def _compute_agent_ids(self): and x.product_id and not x.agent_ids ): - partner = self.move_id.invoice_user_id.partner_id + partner = record.move_id.invoice_user_id.partner_id if partner.agent and partner.salesman_as_agent: - record.agent_ids = [(0, 0, self._prepare_agent_vals(partner))] + record.agent_ids = [(0, 0, record._prepare_agent_vals(partner))] return result