Skip to content

Commit 3941bd1

Browse files
authored
Merge pull request #2966 from ForgeFlow/13.0-fix-adapt-noupdate-data
[13.0][FIX] base: correct adapt noupdate=null data
2 parents 1c5faa0 + df3bcc7 commit 3941bd1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

odoo/addons/base/migrations/13.0.1.3/pre-migration.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -640,13 +640,21 @@ def remove_invoice_table_relations(env):
640640

641641

642642
def fill_ir_model_data_noupdate(env):
643-
"""In previous version, true noupdate data by default was saved as null."""
643+
"""In previous version, true noupdate data by default was saved as null.
644+
See https://github.com/odoo/odoo/commit/8f88570ca18061716fd6e246b9d16aa2cbc24f3a"""
644645
openupgrade.logged_query(
645646
env.cr, """
646647
UPDATE ir_model_data
647648
SET noupdate = TRUE
648-
WHERE noupdate IS NULL"""
649+
WHERE noupdate IS NULL AND model != 'ir.model'"""
649650
)
651+
# In Odoo 13.0, ir.model xmlids are noupdate FALSE instead of NULL and are
652+
# thus included when cleaning up obsolete data records in _process_end.
653+
openupgrade.logged_query(
654+
env.cr,
655+
"""UPDATE ir_model_data
656+
SET noupdate=FALSE
657+
WHERE model='ir.model' AND noupdate IS NULL""")
650658

651659

652660
def remove_offending_translations(env):
@@ -814,10 +822,3 @@ def migrate(env, version):
814822
""" UPDATE ir_model_constraint
815823
SET write_date = date_update
816824
WHERE write_date IS NULL AND date_update IS NOT NULL """)
817-
# In Odoo 13.0, model xmlids are noupdate FALSE instead of NULL and are
818-
# thus included when cleaning up obsolete data records in _process_end.
819-
openupgrade.logged_query(
820-
env.cr,
821-
"""UPDATE ir_model_data
822-
SET noupdate=FALSE
823-
WHERE model='ir.model' AND noupdate IS NULL""")

0 commit comments

Comments
 (0)