Skip to content

Commit f12753e

Browse files
authored
Merge pull request #5537 from Tecnativa/18.0-ou-add-l10n_pe
[18.0][OU-ADD] l10n_pe: Migration scripts
2 parents 0d33739 + 0b34691 commit f12753e

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

docsource/modules170-180.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ Module coverage 17.0 -> 18.0
574574
+---------------------------------------------------+----------------------+-------------------------------------------------+
575575
| l10n_pa | | |
576576
+---------------------------------------------------+----------------------+-------------------------------------------------+
577-
| l10n_pe | | |
577+
| l10n_pe | Done | |
578578
+---------------------------------------------------+----------------------+-------------------------------------------------+
579579
| l10n_pe_pos | |No DB layout changes. |
580580
+---------------------------------------------------+----------------------+-------------------------------------------------+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from openupgradelib import openupgrade
2+
3+
4+
def _disable_obsolete_taxes(env):
5+
"""IN 18.0, some taxes are gone and need to be disabled"""
6+
for xmlid in ["sale_tax_igv_18_included", "purchase_tax_igv_18_included"]:
7+
imds = env["ir.model.data"].search(
8+
[
9+
("module", "=", "account"),
10+
("model", "=", "account.tax"),
11+
("name", "=like", f"%_{xmlid}"),
12+
]
13+
)
14+
taxes = env["account.tax"].browse(imds.mapped("res_id"))
15+
taxes.active = False
16+
17+
18+
@openupgrade.migrate()
19+
def migrate(env, version):
20+
_disable_obsolete_taxes(env)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---Accounting template data---
2+
l10n_pe / account.tax-pe.csv / sale_tax_igv_18_included: DEL
3+
l10n_pe / account.tax-pe.csv / purchase_tax_igv_18_included: DEL
4+
# DONE: Archive existing taxes
5+
6+
---Models in module 'l10n_pe'---
7+
---Fields in module 'l10n_pe'---
8+
l10n_pe / account.move.line / l10n_pe_group_id (many2one) : DEL relation: account.group
9+
l10n_pe / res.bank / l10n_pe_edi_code (char) : NEW
10+
# NOTHING TO DO
11+
12+
---XML records in module 'l10n_pe'---
13+
NEW ir.ui.view: l10n_pe.view_res_bank_inherit_l10n_pe_bank
14+
# NOTHING TO DO

0 commit comments

Comments
 (0)