19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:28 +01:00
parent ff721d030e
commit 7721452493
1826 changed files with 124775 additions and 274114 deletions

View file

@ -37,17 +37,3 @@ def migrate(cr, version):
tuple(tags_68.filtered(lambda tag: not tag.tax_negate).ids)
]
)
cr.execute(
r"""
UPDATE account_move_line
SET tax_audit = REGEXP_REPLACE(tax_audit, '(?<=(^|\s))68:', '60:')
FROM (
SELECT aml.id as aml_id
FROM account_move_line aml
JOIN account_account_tag_account_move_line_rel aml_tag_rel ON aml_tag_rel.account_move_line_id = aml.id
WHERE aml_tag_rel.account_account_tag_id IN %s
) aml
WHERE id = aml.aml_id
""", [tuple(tags_60.ids)]
)

View file

@ -27,20 +27,21 @@ def migrate(cr, version):
# that upgraded won't have the old tags data transferred to the new tags but they will still be able to have the updated sheet.
cr.execute(
"""SELECT 1 FROM ir_model_data
WHERE module='l10n_de' AND name='tag_de_liabilities_bs_B_1'
WHERE module='l10n_de' AND name='tag_de_liabilities_bs_B_1'
""")
if cr.rowcount:
# If the script didn't run, we should remove the tags that have been replaced from ir_model_data too so they're
# not deleted by the ORM if they were already used.
cr.execute(
"""DELETE FROM ir_model_data
WHERE module='l10n_de'
AND name IN ('tag_de_liabilities_bs_F', 'tag_de_liabilities_bs_D_1', 'tag_de_liabilities_bs_D_2',
'tag_de_liabilities_bs_D_3', 'tag_de_liabilities_bs_D_4', 'tag_de_liabilities_bs_D_5',
'tag_de_liabilities_bs_D_6', 'tag_de_liabilities_bs_D_7', 'tag_de_liabilities_bs_D_8')
WHERE module='l10n_de'
AND name IN ('tag_de_liabilities_bs_F', 'tag_de_liabilities_bs_D_1', 'tag_de_liabilities_bs_D_2',
'tag_de_liabilities_bs_D_3', 'tag_de_liabilities_bs_D_4', 'tag_de_liabilities_bs_D_5',
'tag_de_liabilities_bs_D_6', 'tag_de_liabilities_bs_D_7', 'tag_de_liabilities_bs_D_8')
"""
)
return
rename_tag(cr, "tag_de_liabilities_bs_C_1", "tag_de_liabilities_bs_B_1")
rename_tag(cr, "tag_de_liabilities_bs_C_2", "tag_de_liabilities_bs_B_2")
rename_tag(cr, "tag_de_liabilities_bs_C_3", "tag_de_liabilities_bs_B_3")

View file

@ -0,0 +1,22 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details
from odoo import SUPERUSER_ID, api
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
tax_report = env.ref("l10n_de.tax_report", raise_if_not_found=False)
balance_column = env.ref('l10n_de.tax_report_balance', raise_if_not_found=False)
report_lines = [f"l10n_de.tax_report_de_tax_tag_{btw}" for btw in ["17", "18", "19", "31", "46", "55", "64"]] + [
f"l10n_de.tax_report_de_tag_{btw}" for btw in
["01", "02", "17", "18", "19", "25", "26", "27", "31", "33",
"34", "36", "37", "46", "47", "71", "74", "80", "85", "96",
"98"]]
report_lines = [env.ref(line, raise_if_not_found=False) for line in report_lines]
report_line_ids = tuple(line.id for line in report_lines if line)
if balance_column:
cr.execute("DELETE FROM account_report_column WHERE id = %s", (balance_column.id,))
if report_line_ids:
cr.execute("DELETE FROM account_report_line WHERE id IN %s", (report_line_ids,))
if tax_report:
cr.execute("UPDATE account_report_line SET code = NULL WHERE report_id = %s", (tax_report.id,))