Files
contract/product_contract/migrations/12.0.3.0.0/pre-migration.py
sergiocorato 70267731c8 [FIX] migration from 11.0
Update product_contract/migrations/12.0.3.0.0/pre-migration.py

Co-Authored-By: Bejaoui Souheil <souheil_bejaoui@hotmail.fr>

Update product_contract/migrations/12.0.3.0.0/pre-migration.py

Co-Authored-By: Bejaoui Souheil <souheil_bejaoui@hotmail.fr>

[FIX]
2023-03-30 13:59:09 +02:00

15 lines
500 B
Python

from odoo.tools import parse_version
def migrate(cr, version):
if parse_version(version) == parse_version('12.0.2.0.0'):
# pre-paid/post-paid becomes significant for monthlylastday too,
# make sure it has the value that was implied for previous versions.
cr.execute(
"""\
UPDATE product_template
SET recurring_invoicing_type = 'post-paid'
WHERE recurring_rule_type = 'monthlylastday'
"""
)