From 6edd699ee95264028129d8dace48383252e120e8 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 28 Mar 2019 10:45:12 +0000 Subject: [PATCH] [FIX] account_check_printing: Error when clearing the currency Steps to reproduce the bug: - Activate multi currencies on your user - Let's consider currency A and currency B and currency A is the one set on your company - Create a customer invoice I with currency B - Go on the tree view of customer invoices and select I - Click on "Action" and select "Generate an invoice" - On the wizard, clear the currency B Bug: A traceback was raised because the function amount_to_text requires a currency. opw:1958888 closes odoo/odoo#32202 Signed-off-by: Simon Goffin (sig) --- addons/account_check_printing/models/account_payment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py index 28e9f285c1d..cfba4270da8 100644 --- a/addons/account_check_printing/models/account_payment.py +++ b/addons/account_check_printing/models/account_payment.py @@ -28,7 +28,7 @@ class AccountRegisterPayments(models.TransientModel): def _onchange_amount(self): if hasattr(super(AccountRegisterPayments, self), '_onchange_amount'): super(AccountRegisterPayments, self)._onchange_amount() - self.check_amount_in_words = self.currency_id.amount_to_text(self.amount) + self.check_amount_in_words = self.currency_id.amount_to_text(self.amount) if self.currency_id else False def _prepare_payment_vals(self, invoices): res = super(AccountRegisterPayments, self)._prepare_payment_vals(invoices)