[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) <sig@openerp.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user