[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) <ayh@odoo.com>
This commit is contained in:
Swapnesh
2024-03-22 18:27:04 +00:00
committed by Habib (ayh)
parent 388466f42f
commit ebdd177b1b
+1 -1
View File
@@ -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):