TIP: You can type at any time to perform a new search.
Account - Allow updating tax grids
account_update_tax_tags · odoo/odoo
Security findings
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `-- 1.a) Handle base line: relation aml <-> tag, if no relation, tag is NULL WITH base_aml_id_rep_tag_to_insert AS ( SELECT aml.id AS aml_id, rep_tags.account_account_tag_id AS tag_id FROM account_move_line aml JOIN account_move move ON aml.move_id = move.id AND move.company_id = %(company_id)s AND aml.date >= %(date_from)s LEFT JOIN account_move caba_origin_move ON move.tax_cash_basis_origin_move_id = caba_origin_move.id JOIN account_move_line_account_tax_rel aml_to_tax ON aml_to_tax.account_move_line_id = aml.id -- Handle possible children_tax_ids LEFT JOIN account_tax_filiation_rel taxes_filiation ON taxes_filiation.parent_tax = aml_to_tax.account_tax_id JOIN account_tax tax ON tax.id = COALESCE(taxes_filiation.child_tax, aml_to_tax.account_tax_id) JOIN account_tax parent_tax ON aml_to_tax.account_tax_id = parent_tax.id JOIN account_tax_repartition_line tax_to_rep_line -- the repartition line to join depends of the move_type -- also, as this is the base line query, we only join for the base repartition type ON tax_to_rep_line.repartition_type = 'base' AND ( -- invoice type doc ( COALESCE(caba_origin_move.move_type, move.move_type) IN ('in_invoice','out_invoice', 'in_receipt', 'out_receipt') AND tax_to_rep_line.document_type = 'invoice' AND tax_to_rep_line.tax_id = tax.id ) OR -- refund type doc ( COALESCE(caba_origin_move.move_type, move.move_type) IN ('in_refund','out_refund') AND tax_to_rep_line.document_type = 'refund' AND tax_to_rep_line.tax_id = tax.id ) OR -- entry type doc: depends on the tax type -- for base line: -- balance < 0 and sale tax --> invoice -- balance > 0 and sale tax --> refund -- balance > 0 and purchase tax --> invoice -- balance < 0 and purchase tax --> refund -- impossible to decide for balance at 0 --> invoice by default ( COALESCE(caba_origin_move.move_type, move.move_type) = 'entry' AND ( ( COALESCE(parent_tax.type_tax_use, tax.type_tax_use) = 'sale' AND ( aml.balance <= 0 AND tax_to_rep_line.document_type = 'invoice' AND tax_to_rep_line.tax_id = tax.id OR aml.balance > 0 AND tax_to_rep_line.document_type = 'refund' AND tax_to_rep_line.tax_id = tax.id ) ) OR ( COALESCE(parent_tax.type_tax_use, tax.type_tax_use) = 'purchase' AND ( aml.balance >= 0 AND tax_to_rep_line.document_type = 'invoice' AND tax_to_rep_line.tax_id = tax.id OR aml.balance < 0 AND tax_to_rep_line.document_type = 'refund' AND tax_to_rep_line.tax_id = tax.id ) ) ) ) ...` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. No target version is selected: apply version-specific advice only when migrating to that version or later.
- Repository
- odoo/odoo · module folder
- Module version
- 0.1.0
- Category
- Accounting/Accounting
- Folder size
- 0.31 MB
- License
- LGPL-3
- Application
- No
- Auto-installable
- No
- Website
- None
- Last tracking update
- 2026-10-05 00:19:43
- Authors
- Odoo S.A.
- Maintainers
- Odoo S.A.
- Committers
- Raphael Collet, Thibault Delavallée, Odoo Translation Bot, Christophe Matthieu, Luis Torres, Victor Feyens, Tiffany Chang (tic), amdi-odoo, Yosua Nicolaus, Dylan Kiss (dyki), Hesham Saleh, igbe, Julien Launois (jula)
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- None
- Description
This module allows updating tax grids on existing accounting entries. In debug mode a button to update your entries' tax grids will be available in Accounting settings. This is typically useful after some legal changes were done on the tax report, requiring a new tax configuration.
Code Analysis
Views touched (2)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
res_config_settings_view_form |
res.config.settings.view.form.inherit.account_update_tax_tags | res.config.settings | form | Inherits account.res_config_settings_view_form |
view_account_update_tax_tags_wizard_form |
account.update.tax.tags.wizard.form | account.update.tax.tags.wizard | form | New |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (1)
New fields (3)
-
company_idMany2one → res.companycomodel_name='res.company'default=<expr>readonly=Truerequired=True -
date_fromDatecompute='_compute_date_from'help='Date from which journal items will be updated.'readonly=Falserequired=Truestore=Truestring='Starting from' -
display_lock_date_warningBooleancompute='_compute_display_lock_date_warning'
-
update_amls_tax_tags(self)
Loading…
Loading…
Loading…
Loading…
Loading…