Skip to content
Snippets Groups Projects
Commit 2924969d authored by Andrew Gavgavian's avatar Andrew Gavgavian
Browse files

[FIX] various: change domain on aml for move_id.state queries


`Account.move.line` contains a stored related field called `parent_state` which relates to `move_id.state`. This allows for performance improvements by accessing that instead of `move_id.state`.

However, across odoo and enterprise `account.move.line` is domained against `move_id.state`.

This can produce an unnecessary left join on SQL queries for reports or other queries when instead it could use the stored field directly.

To accomplish this fix, we adjust domains to refer to 'parent_state' instead of `move_id.state`

While this PR will adjust multiple modules to fix this domain, it should improve SQL queries over large tables when a left join is no-longer necessary.

opw-3178866

closes odoo/odoo#114730

Related: odoo/enterprise#37939
Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
parent 14f8c49f
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment