diff --git a/commission/models/commission_settlement.py b/commission/models/commission_settlement.py index 6337bb70e..bfebc53f7 100644 --- a/commission/models/commission_settlement.py +++ b/commission/models/commission_settlement.py @@ -60,6 +60,14 @@ class CommissionSettlement(models.Model): default=lambda self: self._default_company_id(), required=True, ) + commission_ids = fields.Many2many( + comodel_name="commission", compute="_compute_commission_ids", store=True + ) + + @api.depends("line_ids.commission_id") + def _compute_commission_ids(self): + for rec in self: + rec.commission_ids = rec.line_ids.mapped("commission_id") def _default_currency_id(self): return self.env.company.currency_id.id diff --git a/commission/views/commission_settlement_views.xml b/commission/views/commission_settlement_views.xml index 8e97bfa2a..537dafc46 100644 --- a/commission/views/commission_settlement_views.xml +++ b/commission/views/commission_settlement_views.xml @@ -6,6 +6,7 @@ + @@ -27,6 +28,7 @@ + @@ -42,6 +44,11 @@ name="group_agent" context="{'group_by': 'agent_id'}" /> + +