diff --git a/wizard/commission_make_settle.py b/wizard/commission_make_settle.py index 5b343069f1a69ed4648246e90f40338224ee7fea..c77ec4f4eaea4861386bf9dd0ff0b9794506de05 100644 --- a/wizard/commission_make_settle.py +++ b/wizard/commission_make_settle.py @@ -21,10 +21,13 @@ class CommissionMakeSettle(models.TransientModel): "commission_id": line.commission_id.id, } if payment: + payment_order = self.env['account.payment.order'].search([ + ('move_id', '=', payment['move_id']) + ]) commission_value = (line.amount * 100 / line.invoice_id.amount_total) / 100 amount = round(payment['amount'] * commission_value, 2) vals['settled_amount'] = amount - vals['associated_payment_id'] = int(payment['payment_id']) + vals['associated_payment_id'] = payment_order.id res.update(vals) return res def _get_settlement(self, agent, company, currency, sett_from, sett_to): @@ -97,6 +100,8 @@ class CommissionMakeSettle(models.TransientModel): return self.action_settle_payment() def action_settle_payment(self): + # import wdb + # wdb.set_trace() self.ensure_one() settlement_obj = self.env["commission.settlement"] settlement_line_obj = self.env["commission.settlement.line"]