From c5290e542785d64aa7f5ff3893a6eadffde085f0 Mon Sep 17 00:00:00 2001 From: mega-odoo Date: Thu, 1 Jun 2023 08:59:07 +0000 Subject: [PATCH] [FIX] l10n_gcc_invoice: prevent trace back while printing an invoice 'ZeroDivisionError: float division by zero' is generated if the user prints an invoice pdf without including an invoice line or invoice line with the product price 0. Steps to Reproduce - Install the 'l10n_gcc_invoice' modules. - Go to the current company and change the country to any Gulf nation, such as Bahrain, Kuwait, Oman, Qatar, Saudi Arabia, or the United Arab Emirates if it isn't already. - Go to Accounting > Configuration > Accounting > Currencies - Activate another currency. - Open an 'Invoices' module - Add the 'currency_id' field in the invoice form view. - Create a new invoice except including the invoice line or invoice line with product price 0 and select a currency that does not equal the current company currency. - And print this invoice. Applying this commit will resolve this issue. sentry-4210558233 closes odoo/odoo#125502 X-original-commit: ae9de44b91b7e80b4a44d69afa69ca95d8f528fe Signed-off-by: Quentin De Paoli Signed-off-by: Josse Colpaert --- addons/l10n_gcc_invoice/views/report_invoice.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_gcc_invoice/views/report_invoice.xml b/addons/l10n_gcc_invoice/views/report_invoice.xml index b0f742f6834..43bee4ed29c 100644 --- a/addons/l10n_gcc_invoice/views/report_invoice.xml +++ b/addons/l10n_gcc_invoice/views/report_invoice.xml @@ -450,7 +450,7 @@
+ t-value="abs(o.amount_total_signed) / o.amount_total if o.amount_total else 0"/>
سعر الصرف
Exchange Rate