Skip to content
Snippets Groups Projects
Commit 2e1a28ec authored by Andrzej(pian)'s avatar Andrzej(pian)
Browse files

[FIX] account : Deprecated accounts shall not appear in suggestions


[Problem]
Before this commit, depreceted accounts were visible in the suggestions.
To reproduce:
- run odoo 16.0 (onward) with modules: account,account_accountant
- deprecate all, but 3 accounts (UPDATE account_account SET deprecated=true WHERE id>3;)
- go to: invoicing app -> Vendors -> Bills -> New
- pick a vendor -> add a line -> click on dropdown in the Account column
- see the deprecated accounts are showed in suggestion (we don't want deprecated accounts in suggestions)

[Solution]
Modified SQL query, such that only not deprecated accounts will appear.

[Testing]
Created test in test_account_account:
It runs function with modified sql query twice:
- with certain account not deprecated -> extected that this account appears in the results
- with the same account deprecated    -> extected that this account won't appears in the results

opw-3485768

closes odoo/odoo#135884

Signed-off-by: default avatarAndrea Grazioso (agr) <agr@odoo.com>
parent 6ee82c26
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment