odoo-addon-openupgrade-scripts 15.0.1.0.0.513__py3-none-any.whl → 15.0.1.0.0.515__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.
@@ -0,0 +1,46 @@
1
+ # Copyright 2023-2024 Tecnativa - Víctor Martínez
2
+ from openupgradelib import openupgrade
3
+
4
+
5
+ @openupgrade.migrate()
6
+ def migrate(env, version):
7
+ """It is important to set the appropriate report_footer and company_details values.
8
+ The report_footer field already existed before, but it only represented the 'extra'
9
+ text that was added after the company data (https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/addons/web/views/report_templates.xml#L367).
10
+ Now in v15 this data https://github.com/odoo/odoo/blob/3a28e5b0adbb36bdb1155a6854cdfbe4e7f9b187/addons/web/views/report_templates.xml#L338
11
+ is not shown unless it is defined; therefore, we must apply the corresponding
12
+ default that would be defined from the base.document.layout wizard and then add the
13
+ old report_footer data (if it was defined).
14
+ There is now a company_details field that does not have a default value, so it will
15
+ be created empty.
16
+ It is important to define the corresponding value that would be defined from the
17
+ base.document.layout wizard because in the report now only the content of that
18
+ field is shown, while in v14 it was not necessary since the address was shown
19
+ according to the partner_id field.
20
+ v14 https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/addons/web/views/report_templates.xml#L343
21
+ vs v15 https://github.com/odoo/odoo/blob/3a28e5b0adbb36bdb1155a6854cdfbe4e7f9b187/addons/web/views/report_templates.xml#L319
22
+ """ # noqa: B950
23
+ for company in env["res.company"].search([]):
24
+ wizard = env["base.document.layout"].with_company(company).create({})
25
+ # We define what the footer should have as it had v14
26
+ # https://github.com/odoo/odoo/blob/cc0060e889603eb2e47fa44a8a22a70d7d784185/addons/web/views/report_templates.xml#L362 # noqa: B950
27
+ report_footer = '<ul class="list-inline">'
28
+ if company.phone:
29
+ report_footer += f'<li class="list-inline-item"><i class="fa fa-phone" role="img"/> <span class="o_force_ltr">{company.phone}</span></li>' # noqa: B950
30
+ if company.email:
31
+ report_footer += f'<li class="list-inline-item"><i class="fa fa-at" role="img"/> <span>{company.email}</span></li>' # noqa: B950
32
+ if company.website:
33
+ report_footer += f'<li class="list-inline-item"><i class="fa fa-globe" role="img"/> <span>{company.website}</span></li>' # noqa: B950
34
+ if company.vat:
35
+ vat_label = company.country_id.vat_label or "Tax ID"
36
+ report_footer += f'<li class="list-inline-item"><i class="fa fa-building-o" role="img"/>{vat_label}: <span>{company.vat}</span></li>' # noqa: B950
37
+ report_footer = "</ul>"
38
+ # Add the extra text (if any) with a separating line
39
+ if company.report_footer:
40
+ report_footer += "<hr>" + company.report_footer
41
+ company.write(
42
+ {
43
+ "report_footer": report_footer,
44
+ "company_details": wizard.company_details,
45
+ }
46
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade_scripts
3
- Version: 15.0.1.0.0.513
3
+ Version: 15.0.1.0.0.515
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)
@@ -685,6 +685,7 @@ odoo/addons/openupgrade_scripts/scripts/uom/15.0.1.0/upgrade_analysis_work.txt,s
685
685
  odoo/addons/openupgrade_scripts/scripts/utm/15.0.1.1/pre-migration.py,sha256=EDXUvH31uyfrEt_afCGNCVdjHC-pjuSAX07_ck1bHU4,263
686
686
  odoo/addons/openupgrade_scripts/scripts/utm/15.0.1.1/upgrade_analysis.txt,sha256=ax5J4E3zUhHJBrsd4W6Gk32N7biptVHHU8pawBQTuc8,303
687
687
  odoo/addons/openupgrade_scripts/scripts/utm/15.0.1.1/upgrade_analysis_work.txt,sha256=5ssz3aNKL19_M8jF098n-QmhvoVzFniteawHQT1Gbog,384
688
+ odoo/addons/openupgrade_scripts/scripts/web/15.0.1.0/post-migration.py,sha256=YQ_ljfv3DxH403QOR__kgVHAydTJq7EFPNbjJLvBnTc,3045
688
689
  odoo/addons/openupgrade_scripts/scripts/web/15.0.1.0/pre-migration.py,sha256=ksJZSCc6UNDb2JCXFm8NuJTYzCocjhIyKLDi8PQ3Tgc,457
689
690
  odoo/addons/openupgrade_scripts/scripts/web/15.0.1.0/upgrade_analysis.txt,sha256=H2zVgDmPCz9pMmJeaOCZlVGinO_5I-pQ4s8CKxSCWiU,1630
690
691
  odoo/addons/openupgrade_scripts/scripts/web/15.0.1.0/upgrade_analysis_work.txt,sha256=ZTAu7NXIKdRgXxpDolLrjaDg8rUpqBX2NVJoRH9E_ps,1708
@@ -807,7 +808,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/15.0.1.0/upgrade_analysi
807
808
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
808
809
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
809
810
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=Q6Orf6ynZuFFVbDWUruBEsSY4uaFaTiVYvLYU1tcCnc,12678
810
- odoo_addon_openupgrade_scripts-15.0.1.0.0.513.dist-info/METADATA,sha256=vYRqb-BOuk2Tc0BF8V23pdRW3nzaIbhFzurUnhKxleg,3758
811
- odoo_addon_openupgrade_scripts-15.0.1.0.0.513.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
812
- odoo_addon_openupgrade_scripts-15.0.1.0.0.513.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
813
- odoo_addon_openupgrade_scripts-15.0.1.0.0.513.dist-info/RECORD,,
811
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.515.dist-info/METADATA,sha256=R4hi1i9soiR0ZOt4yLxN9zVu0lvejU5y_drZQOpjvEg,3758
812
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.515.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
813
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.515.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
814
+ odoo_addon_openupgrade_scripts-15.0.1.0.0.515.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.44.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5