Merge PR #493 into 12.0

Signed-off-by sbejaoui
This commit is contained in:
OCA-git-bot
2020-03-30 09:16:54 +00:00

View File

@@ -1,10 +1,14 @@
from odoo.tools import parse_version
def migrate(cr, version):
# 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'
"""
)
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'
"""
)