odoo-addon-openupgrade-scripts 15.0.1.0.0.541__py3-none-any.whl → 15.0.1.0.0.542__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.
@@ -148,6 +148,22 @@ def _migrate_if(string):
148
148
  return re.sub(pattern, repl_if, string, flags=re.MULTILINE)
149
149
 
150
150
 
151
+ def repl_elif(match):
152
+ """Aux. method. We declare it globally so we don't have scope issues from shell"""
153
+ (elif_expression,) = match.groups()
154
+ elif_expression = html.escape(elif_expression)
155
+ return f'</t>\n<t t-elif="{elif_expression}">'
156
+
157
+
158
+ def _migrate_elif(string):
159
+ """
160
+ Replace mako elif blocks (while closing previous [el]if block)
161
+ Example : '% elif (boolean expression):' -> '</t>\n<t t-elif="(boolean expression)">'
162
+ """
163
+ pattern = r"%\s?elif\s(.+)\s?:"
164
+ return re.sub(pattern, repl_elif, string, flags=re.MULTILINE)
165
+
166
+
151
167
  def repl_for(match):
152
168
  """Aux. method. We declare it globally so we don't have scope issues from shell"""
153
169
  var_name, loop_expression = match.groups()
@@ -211,6 +227,7 @@ def mako_html_to_qweb(string):
211
227
  string = _migrate_if(string)
212
228
  string = _migrate_for(string)
213
229
  string = _migrate_else(string)
230
+ string = _migrate_elif(string)
214
231
  string = _migrate_end(string)
215
232
  string = _migrate_set(string)
216
233
  return string
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade_scripts
3
- Version: 15.0.1.0.0.541
3
+ Version: 15.0.1.0.0.542
4
4
  Summary: Module that contains all the migrations analysis and scripts for migrate Odoo SA modules.
5
5
  Home-page: https://github.com/OCA/OpenUpgrade
6
6
  Author: Odoo Community Association (OCA)
@@ -409,7 +409,7 @@ odoo/addons/openupgrade_scripts/scripts/l10n_vn/15.0.2.0.1/post-migration.py,sha
409
409
  odoo/addons/openupgrade_scripts/scripts/link_tracker/15.0.1.1/upgrade_analysis.txt,sha256=sm_Md5_AZQuf-j862siFIEDnRNumnDjjgSF0EL4hX00,195
410
410
  odoo/addons/openupgrade_scripts/scripts/lunch/15.0.1.0/upgrade_analysis.txt,sha256=YgvkxCZ8V959zAOfxf1dPzUga0vy3-1jSOAUcnkfPYI,6095
411
411
  odoo/addons/openupgrade_scripts/scripts/mail/15.0.1.5/noupdate_changes.xml,sha256=mSFqMrPDjZxwCYbmhe6exCyciL3rTu3w2KzWvShS-nc,1530
412
- odoo/addons/openupgrade_scripts/scripts/mail/15.0.1.5/post-migration.py,sha256=liiBzwuSn6q-ITx5Jfj8Zxxcy5opWYTu103KomYPFJY,8084
412
+ odoo/addons/openupgrade_scripts/scripts/mail/15.0.1.5/post-migration.py,sha256=tzbQGOum8sL-EIOv24X7z7LsMgRE0qlKH1Xy8Hgp2WY,8676
413
413
  odoo/addons/openupgrade_scripts/scripts/mail/15.0.1.5/pre-migration.py,sha256=Y0cAjl_36IvB8n1fecSuFmXaryIyWrab0cvGWl_EjS8,10838
414
414
  odoo/addons/openupgrade_scripts/scripts/mail/15.0.1.5/upgrade_analysis.txt,sha256=31oUo4dhCV2f9bS5_khq1Zpy86kMfjbdm6DzMJ6cqEQ,15672
415
415
  odoo/addons/openupgrade_scripts/scripts/mail/15.0.1.5/upgrade_analysis_work.txt,sha256=8Epm-t7TAcD5gYDOytEDOWEDWEsGJzGoYHBps-ESeWI,17944
@@ -843,7 +843,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/15.0.1.0/upgrade_analysi
843
843
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
844
844
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
845
845
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=Q6Orf6ynZuFFVbDWUruBEsSY4uaFaTiVYvLYU1tcCnc,12678
846
- odoo_addon_openupgrade_scripts-15.0.1.0.0.541.dist-info/METADATA,sha256=iOo0UaLv31w2jgIPV-bJikRkt9pk_LagT79MbZ9x3WI,3758
847
- odoo_addon_openupgrade_scripts-15.0.1.0.0.541.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
848
- odoo_addon_openupgrade_scripts-15.0.1.0.0.541.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
849
- odoo_addon_openupgrade_scripts-15.0.1.0.0.541.dist-info/RECORD,,
846
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.542.dist-info/METADATA,sha256=Spau6X-OgOzuJQx46NIvPRwElyohRBC04pNCVbaIRaY,3758
847
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.542.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
848
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.542.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
849
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.542.dist-info/RECORD,,