Account - Allow updating tax grids
account_update_tax_tags · odoo/odoo
Health
80/100
good
-
Security25/25No findings
-
Activity25/25Last human commit 2 months ago
-
Required by5/250 modules depend on it
-
Maturity25/25In 6 Odoo series since 15.0
Heuristic over the facts below, not an audit · How it's computed
Required by
0
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
LGPL-3
No conflicts with its dependencies
Folder size
0.31 MB
Module directory on disk
Code analysis
1 migration note
1 model
2 views
0 HTTP endpoints
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. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
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.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
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…