odoo-addon-openupgrade-scripts 16.0.1.0.5.2__py3-none-any.whl → 16.0.1.0.5.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,6 +57,16 @@ def convert_field_html_string_bootstrap_4to5(env):
57
57
  ]
58
58
  },
59
59
  }
60
+ # Certain fields had sanitize=False or other sanitization disablings (like
61
+ # sanitize_attributes=False or sanitize_form=False), so when converting to BS 5,
62
+ # we should allow to save the result without re-sanitizing such content. For that,
63
+ # if the user is not on the sanitize overridable group, we add it, removing it after
64
+ # conversion
65
+ group_overridable = False
66
+ if not env.user._has_group("base.group_sanitize_override"):
67
+ group_overridable = env.ref("base.group_sanitize_override")
68
+ env.user.groups_id = [(4, group_overridable.id)]
69
+ # Search
60
70
  fields = env["ir.model.fields"].search(
61
71
  [
62
72
  ("ttype", "=", "html"),
@@ -75,6 +85,9 @@ def convert_field_html_string_bootstrap_4to5(env):
75
85
  env.cr, env[model]._table, field.name
76
86
  ):
77
87
  convert_field_bootstrap_4to5(env, model, field.name, domain=domain)
88
+ # Remove the group if applicable
89
+ if group_overridable:
90
+ env.user.groups_id = [(3, group_overridable.id)]
78
91
 
79
92
 
80
93
  def rename_t_group_website_restricted_editor(env):
@@ -4,3 +4,9 @@ from openupgradelib import openupgrade
4
4
  @openupgrade.migrate()
5
5
  def migrate(env, version):
6
6
  openupgrade.load_data(env.cr, "website", "16.0.1.0/noupdate_changes.xml")
7
+ # Website editors that come from v15, where there was no sanitization, would expect
8
+ # the same on the new version, or worst: they introduce some content like iframe,
9
+ # and re-editing that content in 16 leads to lose it when saving it. Thus, let's
10
+ # add all of them to the override sanitization group for keeping the same behavior.
11
+ users = env.ref("website.group_website_restricted_editor").users
12
+ users.groups_id = [(4, env.ref("base.group_sanitize_override").id)]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade_scripts
3
- Version: 16.0.1.0.5.2
3
+ Version: 16.0.1.0.5.4
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: odoo>=16.0a,<16.1dev
6
6
  Requires-Dist: openupgradelib
@@ -684,9 +684,9 @@ odoo/addons/openupgrade_scripts/scripts/web_editor/16.0.1.0/upgrade_analysis.txt
684
684
  odoo/addons/openupgrade_scripts/scripts/web_editor/16.0.1.0/upgrade_analysis_work.txt,sha256=0aFLxiZZm2pddnvepo7jSIJ3Iek3mnH4oLV7rnG0jRE,213
685
685
  odoo/addons/openupgrade_scripts/scripts/web_tour/16.0.0.1/upgrade_analysis.txt,sha256=_dVyBxQ-ck0iyHgRd6mifxeSsMCRxdpCQcCDVn-lvMk,147
686
686
  odoo/addons/openupgrade_scripts/scripts/web_tour/16.0.0.1/upgrade_analysis_work.txt,sha256=OFVVLWaIounkcVq_mmX4DP7on6of6oG3NFVgMQ2KEZc,163
687
- odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py,sha256=ADEDmXqGOx7AVgXOwzdQe3HsOniDzP6S8DtjnIebgA4,3593
687
+ odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/end-migration.py,sha256=mKK82P_4caB9mgyXo_KvpAEbeSPek12_0mxBvnfp7JM,4302
688
688
  odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/noupdate_changes.xml,sha256=fj5Ae_7zlLILy8NNpY_MYKnNfOvL4-QrJlRbCsUgae8,312
689
- odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/post-migration.py,sha256=o6fuzgKXOoamlXNMm9UYMGrWJ7xEnvyNzRNiK-h-ZWA,169
689
+ odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/post-migration.py,sha256=lXIPEFd-ZT4G3IDV-lJz0VBKIIBWIDuO0Eic4JEYu94,657
690
690
  odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/pre-migration.py,sha256=Invtw62qgK3tIwp8vcjNueh9b5pnztTXfmuMsWiyoBU,4709
691
691
  odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/upgrade_analysis.txt,sha256=vCTXx3AvIGrv58lSrTjB-4tKywuc1XtN-tPnhNAuLQo,4942
692
692
  odoo/addons/openupgrade_scripts/scripts/website/16.0.1.0/upgrade_analysis_work.txt,sha256=5-CSFPNzO01tICIHE49UYTIWFUZdDdl_JdVVRN7MNGI,5331
@@ -790,7 +790,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/16.0.1.0/upgrade_analysi
790
790
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
791
791
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
792
792
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=T3CGCNUVysVD8ysCfwpbPWR5z8x_9vbYNoS4TLHDYOQ,12940
793
- odoo_addon_openupgrade_scripts-16.0.1.0.5.2.dist-info/METADATA,sha256=mMQ8ec5jbl1INAod1cJbgP4nZF-KmkAkfMGzK_n7JpU,3985
794
- odoo_addon_openupgrade_scripts-16.0.1.0.5.2.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
795
- odoo_addon_openupgrade_scripts-16.0.1.0.5.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
796
- odoo_addon_openupgrade_scripts-16.0.1.0.5.2.dist-info/RECORD,,
793
+ odoo_addon_openupgrade_scripts-16.0.1.0.5.4.dist-info/METADATA,sha256=o1p1u7mPnv4028PxcRlAFl21HqtnGcW_1SGyikLeBcI,3985
794
+ odoo_addon_openupgrade_scripts-16.0.1.0.5.4.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
795
+ odoo_addon_openupgrade_scripts-16.0.1.0.5.4.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
796
+ odoo_addon_openupgrade_scripts-16.0.1.0.5.4.dist-info/RECORD,,