From e0a4535aed0cb6880b8368028784e388e7e28cad Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Wed, 25 Jan 2023 08:01:45 +0000 Subject: [PATCH] [FIX] account: show inactive warning only when currency is set before this commit, in active currency warning is shown in the account move form when the currency_field is empty. after this commit, the inactive currency warning will be shown only if the currency is set and it is inactive. forwardported manually closes odoo/odoo#112240 X-original-commit: 1937e4954c6603b36c968fcdb2c08e7d40d21b0a Signed-off-by: Brice Bartoletti (bib) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index de72d8e4f36..91140923a2c 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1272,7 +1272,7 @@ class AccountMove(models.Model): @api.depends('currency_id') def _compute_display_inactive_currency_warning(self): for move in self.with_context(active_test=False): - move.display_inactive_currency_warning = not move.currency_id.active + move.display_inactive_currency_warning = move.currency_id and not move.currency_id.active @api.depends('company_id.account_fiscal_country_id', 'fiscal_position_id', 'fiscal_position_id.country_id', 'fiscal_position_id.foreign_vat') def _compute_tax_country_id(self):