Skip to content
Snippets Groups Projects
Commit d522150c 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#116277

X-original-commit: 72944738970caacecd61b9c29d4dd1ecf6127f30
Related: odoo/enterprise#38604
Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
parent 9ecf263d
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