[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) <bib@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
This commit is contained in:
Andrea Grazioso (agr-odoo)
2023-05-09 06:07:49 +02:00
parent fe21f63c5f
commit 360b95e8eb
@@ -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