Skip to content

Commit

Permalink
[ADD] account_payment_pro: add metohd to compute payment diference
Browse files Browse the repository at this point in the history
  • Loading branch information
maq-adhoc committed Apr 19, 2024
1 parent 83cbd20 commit baa92ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions account_payment_pro/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,13 @@ def _compute_amount_company_currency_signed_pro(self):
else:
payment.amount_company_currency_signed_pro = payment.amount_company_currency

def _get_payment_difence(self):
return self.to_pay_amount - self.amount_company_currency_signed_pro

@api.depends('to_pay_amount', 'amount_company_currency_signed_pro')
def _compute_payment_difference(self):
for rec in self:
# if rec.payment_subtype != 'double_validation':
# continue
rec.payment_difference = rec.to_pay_amount - rec.amount_company_currency_signed_pro
rec.payment_difference = rec._get_payment_difence()

@api.depends('to_pay_move_line_ids.amount_residual')
def _compute_selected_debt(self):
Expand Down

0 comments on commit baa92ab

Please sign in to comment.