Skip to content

Commit

Permalink
[FIX] account_payment_term_surcharge: float_round
Browse files Browse the repository at this point in the history
ticket 64738
  • Loading branch information
ica-adhoc authored and jjscarafia committed Aug 29, 2023
1 parent 5c6812b commit ca7c583
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion account_payment_term_surcharge/models/account_move.py
@@ -1,5 +1,6 @@
from odoo import fields, models, _, api
from odoo.exceptions import UserError
from odoo.tools import float_round

import logging
_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -73,7 +74,7 @@ def _add_surcharge_line(self, debit_note, product, debt, to_date, surcharge):
})]})
debit_note = debit_note.with_context(check_move_validity=False)
debit_note.invoice_line_ids._onchange_product_id()
debit_note.invoice_line_ids[0].price_unit = (surcharge / 100) * debt
debit_note.invoice_line_ids[0].price_unit = float_round((surcharge / 100) * debt, precision_digits=2)
debit_note.invoice_line_ids[0].name = product.name + '.\n' + comment
debit_note._recompute_dynamic_lines()

Expand Down

0 comments on commit ca7c583

Please sign in to comment.