Skip to content
Merged
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
17 changes: 16 additions & 1 deletion openupgrade_scripts/scripts/web/17.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

@openupgrade.migrate()
def migrate(env, version):
web_pwa_oca_installed = env["ir.config_parameter"].get_param("pwa.manifest.name")
ICP = env["ir.config_parameter"]
web_pwa_oca_installed = ICP.get_param("pwa.manifest.name")
if web_pwa_oca_installed:
openupgrade.rename_fields(
env,
Expand All @@ -27,3 +28,17 @@ def migrate(env, version):
WHERE key = 'pwa.manifest.name'
""",
)
# Deduce whether it is necessary to install web_pwa_customize based on the
# values previously defined in web_pwa_oca and the values that web will now use.
short_name = ICP.get_param("pwa.manifest.short_name")
background_color = ICP.get_param("pwa.manifest.background_color")
theme_color = ICP.get_param("pwa.manifest.theme_color")
if short_name or background_color != "#714B67" or theme_color != "#714B67":
openupgrade.logged_query(
env.cr,
"""
UPDATE ir_module_module
SET state = 'to install'
WHERE name = 'web_pwa_customize'
""",
)