Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions addons/l10n_it/migrations/0.8/pre-migrate.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
from odoo.tools.sql import column_exists


def migrate(cr, version):

cr.execute("""
UPDATE account_tax
SET l10n_it_exempt_reason = CASE
WHEN l10n_it_exempt_reason = 'N2' THEN 'N2.2'
WHEN l10n_it_exempt_reason = 'N3' THEN 'N3.6'
WHEN l10n_it_exempt_reason = 'N6' THEN 'N6.9'
END
WHERE l10n_it_exempt_reason IN ('N2', 'N3', 'N6')
""")
if column_exists(cr, "account_tax", "l10n_it_exempt_reason"):
cr.execute("""
UPDATE account_tax
SET l10n_it_exempt_reason = CASE
WHEN l10n_it_exempt_reason = 'N2' THEN 'N2.2'
WHEN l10n_it_exempt_reason = 'N3' THEN 'N3.6'
WHEN l10n_it_exempt_reason = 'N6' THEN 'N6.9'
END
WHERE l10n_it_exempt_reason IN ('N2', 'N3', 'N6')
""")