Skip to content

Commit

Permalink
[ADDD] account_payment_group_financial_surcharge: Avoid ND = 0
Browse files Browse the repository at this point in the history
If the financial plan does not add any subcharge we should not
create a ND amount 0. Only create the ND when we have a subcharge to
apply
  • Loading branch information
zaoral committed Feb 10, 2023
1 parent 2181083 commit 31ff78f
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -19,7 +19,7 @@ def _computed_financing_surcharge(self):
rec.financing_surcharge = sum(rec.payment_ids.filtered('financing_plan_id').mapped(lambda x: x.amount - x.net_amount))

def post(self):
if self.payment_ids.mapped('financing_plan_id'):
if self.filtered(lambda p: p.financing_surcharge > 0):
product = self.company_id.product_surcharge_id
if not product:
raise UserError(
Expand Down

0 comments on commit 31ff78f

Please sign in to comment.