[FIX] account: correctly compare floats
opw-3641270 closes odoo/odoo#148369 X-original-commit: 1a6aa05081e900731fc7821b1582985e545a542a Signed-off-by: Laurent Smet (las) <las@odoo.com> Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
This commit is contained in:
@@ -3694,7 +3694,11 @@ class AccountMove(models.Model):
|
||||
raise AccessError(_("You don't have the access rights to post an invoice."))
|
||||
|
||||
for invoice in self.filtered(lambda move: move.is_invoice(include_receipts=True)):
|
||||
if invoice.quick_edit_mode and invoice.quick_edit_total_amount and invoice.quick_edit_total_amount != invoice.amount_total:
|
||||
if (
|
||||
invoice.quick_edit_mode
|
||||
and invoice.quick_edit_total_amount
|
||||
and invoice.currency_id.compare_amounts(invoice.quick_edit_total_amount, invoice.amount_total) != 0
|
||||
):
|
||||
raise UserError(_(
|
||||
"The current total is %s but the expected total is %s. In order to post the invoice/bill, "
|
||||
"you can adjust its lines or the expected Total (tax inc.).",
|
||||
|
||||
Reference in New Issue
Block a user