Skip to content

fix(om_account_budget): replace _where_calc/_apply_ir_rules with read…#196

Open
Aadarsh-06 wants to merge 1 commit into
odoomates:19.0from
Aadarsh-06:19.0
Open

fix(om_account_budget): replace _where_calc/_apply_ir_rules with read…#196
Aadarsh-06 wants to merge 1 commit into
odoomates:19.0from
Aadarsh-06:19.0

Conversation

@Aadarsh-06

Copy link
Copy Markdown

Summary
Replaces the deprecated _where_calc() and _apply_ir_rules() raw SQL pattern in _compute_practical_amount with the ORM read_group() API, fixing compatibility with Odoo 19.

Changes
account.analytic.line amount query now uses read_group(domain, ['amount:sum'], [])
account.move.line credit/debit query now uses read_group(domain, ['credit:sum', 'debit:sum'], [])
Removed manual raw SQL execution via env.cr.execute()

Why
_where_calc() and _apply_ir_rules() were removed in Odoo 17+ and cause errors in Odoo 19. The read_group() replacement is the idiomatic ORM approach and handles security rules automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant