From 360b95e8eb6f30d55d4433e2d45ed2dd49e3ee9e Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Fri, 5 May 2023 15:28:01 +0000 Subject: [PATCH] [FIX] account: search for deprecated account Duplicate the default Account Payable (211000) Set the default Account Payable to Deprecated Create a Vendor Bill with a line Save Error will raise The account Account Payable (211000) is deprecated. opw-3199157 opw-3229350 closes odoo/odoo#120799 X-original-commit: 0dc11ed2e4e530ddefe4310fa6bef7001f20ecc1 Signed-off-by: Brice Bartoletti (bib) Signed-off-by: Grazioso Andrea (agr) --- addons/account/models/account_move_line.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/models/account_move_line.py b/addons/account/models/account_move_line.py index 28898b54284..57b1bcea2be 100644 --- a/addons/account/models/account_move_line.py +++ b/addons/account/models/account_move_line.py @@ -543,6 +543,7 @@ class AccountMoveLine(models.Model): FROM account_account account WHERE account.company_id = ANY(%(company_ids)s) AND account.account_type IN ('asset_receivable', 'liability_payable') + AND account.deprecated = 'f' ) SELECT * FROM previous UNION ALL