From ebdd177b1be6c8e2cd543e748b9862d6688b7742 Mon Sep 17 00:00:00 2001 From: Swapnesh Date: Wed, 20 Mar 2024 18:24:08 +0000 Subject: [PATCH] [FIX] account: do not show alert on posted invoice/bill Steps to reproduce: * Activate multi-currency (Company currency `USD`, another currency activated 'EUR') * Create invoice/bill in `EUR` and post it * Archive `EUR' * Open Invoice/Bill Issue: * Alert for inactivated currency is always displayed Fix: * Alert for inactivated currency should be displayed in draft state only closes odoo/odoo#158802 X-original-commit: 72a0058ec748a03351ab3ad7536ff7089f84262e Signed-off-by: Habib Ayob (ayh) --- 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 2329c551de6..681394a944a 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1406,7 +1406,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 = move.currency_id and not move.currency_id.active + move.display_inactive_currency_warning = move.state == 'draft' and 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):