diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 527e80e3d6d..4f57d6c1d1e 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3713,7 +3713,7 @@ class AccountMove(models.Model): move.currency_id.name )) - if move.line_ids.account_id.filtered(lambda account: account.deprecated): + if move.line_ids.account_id.filtered(lambda account: account.deprecated) and not self._context.get('skip_account_deprecation_check'): raise UserError(_("A line of this move is using a deprecated account, you cannot post it.")) if soft: diff --git a/addons/account/models/account_move_line.py b/addons/account/models/account_move_line.py index fa02a11ef34..11ea9f7fdc8 100644 --- a/addons/account/models/account_move_line.py +++ b/addons/account/models/account_move_line.py @@ -1225,7 +1225,7 @@ class AccountMoveLine(models.Model): account = line.account_id journal = line.move_id.journal_id - if account.deprecated: + if account.deprecated and not self.env.context.get('skip_account_deprecation_check'): raise UserError(_('The account %s (%s) is deprecated.', account.name, account.code)) account_currency = account.currency_id