[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) <bib@odoo.com>
This commit is contained in:
niyasraphy
2023-02-08 19:26:40 +01:00
committed by Brice bib Bartoletti
parent 7ded1a7acc
commit e0a4535aed
+1 -1
View File
@@ -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):