Skip to content

Commit

Permalink
[FIX] precompute _compute_selected_debt
Browse files Browse the repository at this point in the history
  • Loading branch information
maq-adhoc committed Apr 20, 2024
1 parent 4572aa1 commit cfcef60
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 @@ -96,7 +96,8 @@ class AccountPayment(models.Model):
help='This lines are the ones the user has selected to be paid.',
copy=False,
readonly=False,
check_company=True
check_company=True,
precompute=True,
)
matched_move_line_ids = fields.Many2many(
'account.move.line',
Expand Down Expand Up @@ -399,7 +400,7 @@ def _compute_payment_difference(self):
for rec in self:
rec.payment_difference = rec._get_payment_difference()

@api.depends('to_pay_move_line_ids.amount_residual')
@api.depends('to_pay_move_line_ids', 'to_pay_move_line_ids.amount_residual')
def _compute_selected_debt(self):
for rec in self:
# factor = 1
Expand All @@ -425,7 +426,7 @@ def _inverse_to_pay_amount(self):
def _compute_to_pay_move_lines(self):
# TODO deberiamos ver que se recomputen solo si la deuda que esta seleccionada NO es de este
# partner, compania o partner_type
# # if payment group is being created from a payment we dont want to compute to_pay_move_lines
# # if payment group is being created from a payment we dont want to compute to_pay_move_lines
# if self._context.get('created_automatically'):
# return
for rec in self:
Expand Down

0 comments on commit cfcef60

Please sign in to comment.