odoo-addon-openupgrade-scripts 16.0.1.0.3.162__py3-none-any.whl → 16.0.1.0.3.166__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.
@@ -24,7 +24,6 @@ renamed_modules = {
24
24
  # OCA/knowledge
25
25
  "knowledge": "document_knowledge",
26
26
  # OCA/pos
27
- "pos_journal_image": "pos_payment_method_image",
28
27
  # OCA/sale-promotion
29
28
  "coupon_incompatibility": "loyalty_incompatibility",
30
29
  "coupon_limit": "loyalty_limit",
@@ -0,0 +1,69 @@
1
+ # Copyright 2023 Viindoo - Nguyễn Việt Lâm
2
+ # Copyright 2024 Tecnativa - Pedro M. Baeza
3
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4
+ from openupgradelib import openupgrade
5
+
6
+
7
+ def _fill_source_type_external(env):
8
+ """Switch to external for those with `google_drive_id`, that are the only where
9
+ these applies:
10
+ https://github.com/odoo/odoo/blob/42bcc3ef284ca355e2323641176573b53e7d2e28/addons/
11
+ website_slides/controllers/main.py#L1197
12
+ """
13
+ env["slide.slide"].search([]).filtered("google_drive_id").source_type = "external"
14
+
15
+
16
+ def _fill_nbr_article(env):
17
+ """Fill the values recreating the compute method, but only for the field
18
+ nbr_article.
19
+ """
20
+ for source in ["slide", "channel"]:
21
+ if source == "slide":
22
+ records = env["slide.slide"].search([("is_category", "=", True)])
23
+ field = "category_id"
24
+ else:
25
+ records = env["slide.channel"].search([])
26
+ field = "channel_id"
27
+ domain = [
28
+ ("is_published", "=", True),
29
+ ("is_category", "=", False),
30
+ (field, "in", records.ids),
31
+ ]
32
+ res = env["slide.slide"]._read_group(
33
+ domain,
34
+ [field, "slide_category"],
35
+ [field, "slide_category"],
36
+ lazy=False,
37
+ )
38
+ category_stats = records._compute_slides_statistics_category(res)
39
+ for record in records:
40
+ record.nbr_article = category_stats.get(
41
+ record._origin.id, {"nb_article": 0}
42
+ )["nbr_article"]
43
+
44
+
45
+ @openupgrade.migrate()
46
+ def migrate(env, version):
47
+ openupgrade.load_data(env.cr, "website_slides", "16.0.2.6/noupdate_changes.xml")
48
+ openupgrade.delete_record_translations(
49
+ env.cr,
50
+ "website_slides",
51
+ [
52
+ "mail_template_channel_completed",
53
+ "mail_template_slide_channel_invite",
54
+ ],
55
+ ["name", "subject", "description"],
56
+ )
57
+ openupgrade.delete_record_translations(
58
+ env.cr,
59
+ "website_slides",
60
+ ["mail_template_slide_channel_invite"],
61
+ ["name", "description"],
62
+ )
63
+ openupgrade.delete_record_translations(
64
+ env.cr,
65
+ "website_slides",
66
+ ["slide_template_published", "slide_template_shared"],
67
+ )
68
+ _fill_source_type_external(env)
69
+ _fill_nbr_article(env)
@@ -0,0 +1,98 @@
1
+ # Copyright 2023 Viindoo - Nguyễn Việt Lâm
2
+ # Copyright 2024 Tecnativa - Pedro M. Baeza
3
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4
+ from openupgradelib import openupgrade
5
+
6
+ renamed_fields = [
7
+ ("slide.slide", "slide_slide", "datas", "binary_content"),
8
+ ("slide.channel", "slide_channel", "share_template_id", "share_slide_template_id"),
9
+ ]
10
+ xml_ids_to_rename = [
11
+ (
12
+ "website_slides.rule_slide_slide_resource_manager",
13
+ "website_slides.rule_slide_slide_resource_downloadable_manager",
14
+ ),
15
+ ]
16
+
17
+
18
+ def _create_and_fill_data_from_slide_type_to_slide_category(env):
19
+ openupgrade.copy_columns(
20
+ env.cr, {"slide_slide": [("slide_type", "slide_category", None)]}
21
+ )
22
+ openupgrade.map_values(
23
+ env.cr,
24
+ "slide_type",
25
+ "slide_category",
26
+ [("webpage", "article"), ("presentation", "document")],
27
+ table="slide_slide",
28
+ )
29
+ openupgrade.rename_columns(env.cr, {"slide_slide": [("slide_type", None)]})
30
+
31
+
32
+ def _create_and_fill_data_for_source_type(env):
33
+ openupgrade.logged_query(
34
+ env.cr,
35
+ "ALTER TABLE slide_slide ADD COLUMN IF NOT EXISTS source_type VARCHAR",
36
+ )
37
+ openupgrade.logged_query(
38
+ env.cr,
39
+ """
40
+ UPDATE slide_slide
41
+ SET source_type = CASE
42
+ WHEN url IS NOT NULL AND slide_category = 'document' THEN 'external'
43
+ ELSE 'local_file'
44
+ END
45
+ """,
46
+ )
47
+
48
+
49
+ def _create_column_and_migrate_data_from_slide_link_to_slide_resource(env):
50
+ openupgrade.logged_query(
51
+ env.cr,
52
+ """
53
+ ALTER TABLE slide_slide_resource
54
+ ADD COLUMN IF NOT EXISTS link VARCHAR,
55
+ ADD COLUMN IF NOT EXISTS resource_type VARCHAR
56
+ """,
57
+ )
58
+ openupgrade.logged_query(
59
+ env.cr,
60
+ "UPDATE slide_slide_resource SET resource_type = 'file'",
61
+ )
62
+ openupgrade.logged_query(
63
+ env.cr,
64
+ """
65
+ INSERT INTO slide_slide_resource
66
+ (name, link, slide_id, resource_type)
67
+ SELECT name, link, slide_id, 'url'
68
+ FROM slide_slide_link
69
+ """,
70
+ )
71
+
72
+
73
+ def _create_nbr_article(env):
74
+ """Pre-create and fill these fields for avoiding KeyError crashes as the compute
75
+ method uses read_group.
76
+ """
77
+ openupgrade.logged_query(
78
+ env.cr,
79
+ "ALTER TABLE slide_channel ADD COLUMN IF NOT EXISTS nbr_article INT4",
80
+ )
81
+ openupgrade.logged_query(
82
+ env.cr,
83
+ "ALTER TABLE slide_slide ADD COLUMN IF NOT EXISTS nbr_article INT4 DEFAULT 0",
84
+ )
85
+ openupgrade.logged_query(
86
+ env.cr,
87
+ "ALTER TABLE slide_slide ALTER COLUMN nbr_article DROP DEFAULT",
88
+ )
89
+
90
+
91
+ @openupgrade.migrate()
92
+ def migrate(env, version):
93
+ openupgrade.rename_fields(env, renamed_fields)
94
+ openupgrade.rename_xmlids(env.cr, xml_ids_to_rename)
95
+ _create_and_fill_data_from_slide_type_to_slide_category(env)
96
+ _create_column_and_migrate_data_from_slide_link_to_slide_resource(env)
97
+ _create_and_fill_data_for_source_type(env)
98
+ _create_nbr_article(env)
@@ -0,0 +1,122 @@
1
+ ---Models in module 'website_slides'---
2
+ obsolete model slide.slide.link
3
+ website_slides / slide.slide.link / link (char) : DEL required
4
+ website_slides / slide.slide.link / name (char) : DEL required
5
+ website_slides / slide.slide.link / slide_id (many2one) : DEL relation: slide.slide, required
6
+ # DONE: move data from slide.slide.link to slide.slide.resource in pre-migration
7
+ # REASON: previously website_slides seperate slide.slide.link and slide.slide.resource one is store url another store file. Now combined into slide.slide.resource
8
+
9
+ ---Fields in module 'website_slides'---
10
+ website_slides / slide.channel / cover_properties (text) : NEW hasdefault: default
11
+ # NOTHING TO DO: New feature to customize the cover of the course.
12
+
13
+ website_slides / slide.channel / nbr_article (integer) : NEW isfunction: function, stored
14
+ website_slides / slide.slide / nbr_article (integer) : NEW isfunction: function, stored
15
+ # DONE: pre-migration: Pre-create and fill the field for avoiding KeyError in the compute as it uses `read_group` method.
16
+ # DONE: post-migration: Fill the field using ORM recreating the compute method, as the computation by SQL gets hard and it doesn't worth due to the scope.
17
+
18
+ website_slides / slide.channel / nbr_presentation (integer) : DEL
19
+ website_slides / slide.channel / nbr_webpage (integer) : DEL
20
+ # NOTHING TO DO: executed by ORM
21
+
22
+ website_slides / slide.channel / share_channel_template_id (many2one): NEW relation: mail.template, hasdefault: default
23
+ # NOTHING TO DO: This value is needed for sharing the channel, so better to have one filled, and the default one given by ORM is OK.
24
+
25
+ website_slides / slide.channel / share_slide_template_id (many2one): NEW relation: mail.template, hasdefault: default
26
+ website_slides / slide.channel / share_template_id (many2one) : DEL relation: mail.template
27
+ website_slides / slide.slide / binary_content (binary) : NEW attachment: True
28
+ website_slides / slide.slide / datas (binary) : DEL attachment: True
29
+ # DONE: pre-migration: renamed fields
30
+
31
+ website_slides / slide.slide / document_id (char) : DEL
32
+ # NOTHING TO DO: Following the logic where this field was involved, now it is computed on the fly (stored=False) from URL.
33
+
34
+ website_slides / slide.slide / embed_ids (one2many) : NEW relation: slide.embed
35
+ website_slides / slide.slide / embedcount_ids (one2many) : DEL relation: slide.embed
36
+ # NOTHING TO DO: rename from embedcount_ids to embed_ids still one2many type
37
+
38
+ website_slides / slide.slide / link_ids (one2many) : DEL relation: slide.slide.link
39
+ website_slides / slide.slide / mime_type (char) : DEL
40
+ website_slides / slide.slide / nbr_presentation (integer) : DEL
41
+ website_slides / slide.slide / nbr_webpage (integer) : DEL
42
+ # NOTHING TO DO
43
+
44
+ website_slides / slide.slide / slide_category (selection) : NEW required, selection_keys: ['article', 'document', 'infographic', 'quiz', 'video'], hasdefault: default
45
+ # DONE: pre-migration: copy column slide_type + map values that changes
46
+
47
+ website_slides / slide.slide / slide_type (selection) : selection_keys is now '['article', 'doc', 'google_drive_video', 'image', 'pdf', 'quiz', 'sheet', 'slides', 'vimeo_video', 'youtube_video']' ('['document', 'infographic', 'presentation', 'quiz', 'video', 'webpage']')
48
+ # NOTHING TO DO: Let ORM handle recomputes this field
49
+
50
+ website_slides / slide.slide / source_type (selection) : NEW required, selection_keys: ['external', 'local_file'], hasdefault: default
51
+ # DONE: post-migration: Switch to external for those with `google_drive_id`, that are the only where these applies: https://github.com/odoo/odoo/blob/42bcc3ef284ca355e2323641176573b53e7d2e28/addons/website_slides/controllers/main.py#L1197
52
+
53
+ website_slides / slide.slide.resource / file_name (char) : NEW
54
+ # NOTHING TO DO
55
+
56
+ website_slides / slide.slide.resource / link (char) : NEW hasdefault: compute
57
+ website_slides / slide.slide.resource / resource_type (selection) : NEW required, selection_keys: ['file', 'url']
58
+ # DONE: pre-migration: create column and fill data
59
+
60
+ ---XML records in module 'website_slides'---
61
+ NEW ir.actions.act_window: website_slides.action_slide_channel_pages_list
62
+ NEW ir.actions.act_window: website_slides.slide_channel_action_add
63
+ NEW ir.actions.act_window: website_slides.slide_embed_action
64
+ NEW ir.actions.act_window: website_slides.slide_slide_partner_action_from_slide
65
+ DEL ir.actions.act_window: website_slides.rating_rating_action_slide_channel_report
66
+ NEW ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_view_form
67
+ NEW ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_view_graph
68
+ NEW ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_view_kanban
69
+ NEW ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_view_pivot
70
+ NEW ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_view_tree
71
+ NEW ir.actions.act_window.view: website_slides.slide_channel_action_report_view_form
72
+ NEW ir.actions.act_window.view: website_slides.slide_channel_action_report_view_graph
73
+ NEW ir.actions.act_window.view: website_slides.slide_channel_action_report_view_pivot
74
+ NEW ir.actions.act_window.view: website_slides.slide_channel_action_report_view_tree
75
+ NEW ir.actions.act_window.view: website_slides.slide_slide_action_report_view_form
76
+ NEW ir.actions.act_window.view: website_slides.slide_slide_action_report_view_graph
77
+ NEW ir.actions.act_window.view: website_slides.slide_slide_action_report_view_pivot
78
+ NEW ir.actions.act_window.view: website_slides.slide_slide_action_report_view_tree
79
+ DEL ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_report_view_graph
80
+ DEL ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_report_view_pivot
81
+ DEL ir.actions.act_window.view: website_slides.rating_rating_action_slide_channel_report_view_tree
82
+ # NOTHING TO DO
83
+
84
+ DEL ir.model.access: website_slides.access_slide_slide_link_all
85
+ DEL ir.model.access: website_slides.access_slide_slide_link_officer
86
+ # NOTHING TO DO
87
+
88
+ NEW ir.model.constraint: website_slides.constraint_slide_channel_partner_channel_partner_uniq
89
+ NEW ir.model.constraint: website_slides.constraint_slide_channel_partner_check_completion
90
+ NEW ir.model.constraint: website_slides.constraint_slide_slide_partner_check_vote
91
+ NEW ir.model.constraint: website_slides.constraint_slide_slide_partner_slide_partner_uniq
92
+ NEW ir.model.constraint: website_slides.constraint_slide_slide_resource_check_file_type
93
+ NEW ir.model.constraint: website_slides.constraint_slide_slide_resource_check_url
94
+ # NOTHING TO DO
95
+
96
+
97
+ NEW ir.rule: website_slides.rule_slide_slide_resource_downloadable_manager (noupdate)
98
+ DEL ir.rule: website_slides.rule_slide_slide_resource_manager (noupdate)
99
+ # DONE: rename xmlid in pre-migration
100
+
101
+ NEW ir.ui.menu: website_slides.menu_slide_channel_pages
102
+ DEL ir.ui.menu: website_slides.website_slides_menu_courses_reviews
103
+ NEW ir.ui.view: website_slides.course_join
104
+ NEW ir.ui.view: website_slides.rating_rating_view_form_slides
105
+ NEW ir.ui.view: website_slides.rating_rating_view_tree_slide_channel
106
+ NEW ir.ui.view: website_slides.slide_channel_pages_kanban_view
107
+ NEW ir.ui.view: website_slides.slide_channel_pages_tree_view
108
+ NEW ir.ui.view: website_slides.slide_channel_view_form_add
109
+ NEW ir.ui.view: website_slides.slide_channel_view_pivot
110
+ NEW ir.ui.view: website_slides.slide_embed_view_search
111
+ NEW ir.ui.view: website_slides.slide_embed_view_tree
112
+ NEW ir.ui.view: website_slides.slide_sidebar_done_button
113
+ NEW ir.ui.view: website_slides.slide_slide_partner_view_form
114
+ NEW ir.ui.view: website_slides.slide_slide_partner_view_search
115
+ NEW ir.ui.view: website_slides.slide_slide_partner_view_tree
116
+ NEW ir.ui.view: website_slides.slide_slide_view_tree_report
117
+ NEW ir.ui.view: website_slides.snippet_options
118
+ DEL ir.ui.view: website_slides.rating_rating_view_kanban_slide_channel
119
+ DEL ir.ui.view: website_slides.slide_edit_options
120
+ DEL ir.ui.view: website_slides.user_navbar_inherit_website_slides
121
+ NEW mail.template: website_slides.mail_template_channel_shared (noupdate)
122
+ # NOTHING TO DO
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade-scripts
3
- Version: 16.0.1.0.3.162
3
+ Version: 16.0.1.0.3.166
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)
@@ -1,7 +1,7 @@
1
1
  odoo/addons/openupgrade_scripts/README.rst,sha256=tNIgN-fE7UT1K-zMaK80ewZZOUaxzqYgufpYk2PHckU,3185
2
2
  odoo/addons/openupgrade_scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  odoo/addons/openupgrade_scripts/__manifest__.py,sha256=pE4R-JQdRitStZ2m2AN39foAoEfLWmwuL9nhHP1i3r8,614
4
- odoo/addons/openupgrade_scripts/apriori.py,sha256=F8CbDJ2wWgr5sounfe_DyjnGB3fmYMGCDbTMAjCz2TI,5008
4
+ odoo/addons/openupgrade_scripts/apriori.py,sha256=us-1ykM1dpS-y1nJcgk3o2OvaF-2zQ8G8pjk-qnYtk0,4955
5
5
  odoo/addons/openupgrade_scripts/readme/CONFIGURE.rst,sha256=cy1swpDkuqi9-6q8L1M1QD058QyfBvAE2PN_mmdxvwI,255
6
6
  odoo/addons/openupgrade_scripts/readme/DESCRIPTION.rst,sha256=ckrM5YlY8awluPWIV7WOBynTOG_QKOjXrCsXD_RhmyU,86
7
7
  odoo/addons/openupgrade_scripts/readme/INSTALL.rst,sha256=tXbOmw3QIhO1KLIziMpXzuuY0tOhI8IGT2ktCArwfGM,115
@@ -627,7 +627,10 @@ odoo/addons/openupgrade_scripts/scripts/website_sale_stock/16.0.1.0/upgrade_anal
627
627
  odoo/addons/openupgrade_scripts/scripts/website_sale_stock_wishlist/16.0.1.0/upgrade_analysis.txt,sha256=Su-F698eC2SIY29887O6dZDUZxFp_ckwSXM5C9xKRCk,550
628
628
  odoo/addons/openupgrade_scripts/scripts/website_sale_wishlist/16.0.1.0/upgrade_analysis.txt,sha256=dkoH9dzqNnIfxVpZY78SGzUVWymC_Xt9Hb7bdKIjzww,186
629
629
  odoo/addons/openupgrade_scripts/scripts/website_slides/16.0.2.6/noupdate_changes.xml,sha256=lM3LtWWH2vPTtYgv8PTZFxdlXre5cheWRpxMOcIjnao,4027
630
+ odoo/addons/openupgrade_scripts/scripts/website_slides/16.0.2.6/post-migration.py,sha256=_ppoN3BZKI73ribYBpJsnl3pETq3ChFYNRasv_Y-qPw,2335
631
+ odoo/addons/openupgrade_scripts/scripts/website_slides/16.0.2.6/pre-migration.py,sha256=cdu5KZdfuzEP-lMs9B-_ZdkUkVzjehC6-wFUmBjGQ00,3009
630
632
  odoo/addons/openupgrade_scripts/scripts/website_slides/16.0.2.6/upgrade_analysis.txt,sha256=12sfLR0d-5-qEZHGzpHZ68B2GIYrGCdzQylTh0uMtvU,6921
633
+ odoo/addons/openupgrade_scripts/scripts/website_slides/16.0.2.6/upgrade_analysis_work.txt,sha256=Tjo_5oFMg3Y9xAQFTSB85qLrdHKnA-NqXLyLFqy9eKo,8482
631
634
  odoo/addons/openupgrade_scripts/scripts/website_slides_forum/16.0.1.0/upgrade_analysis.txt,sha256=Rcjr_T76A1-IyLZOeEn3wixWEMgU2soTE49va5yhlII,472
632
635
  odoo/addons/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/noupdate_changes.xml,sha256=GJgxpiR2xWhKga9UbHjtB1fn-F3zuOIgzHXjK5s6Fs8,302
633
636
  odoo/addons/openupgrade_scripts/scripts/website_slides_survey/16.0.1.0/upgrade_analysis.txt,sha256=iuvghMze0rUSxpsv8rKRTnivPoOljAwXIXKsTRRdSFA,1773
@@ -635,7 +638,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/16.0.1.0/upgrade_analysi
635
638
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
636
639
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
637
640
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=IOWtZdzr_jN_Dja8HYIfzIxrO8NE5pFgazKJtPsLKw0,12678
638
- odoo_addon_openupgrade_scripts-16.0.1.0.3.162.dist-info/METADATA,sha256=mToTaIa8ClQEiWd4R-Qr5HGseR1Vt8uH9mA-ACzc9b4,3810
639
- odoo_addon_openupgrade_scripts-16.0.1.0.3.162.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
640
- odoo_addon_openupgrade_scripts-16.0.1.0.3.162.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
641
- odoo_addon_openupgrade_scripts-16.0.1.0.3.162.dist-info/RECORD,,
641
+ odoo_addon_openupgrade_scripts-16.0.1.0.3.166.dist-info/METADATA,sha256=BE_9G6FLPtuQfUUZR3HLTrVFCbU6eWPTopMMceQkuhI,3810
642
+ odoo_addon_openupgrade_scripts-16.0.1.0.3.166.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
643
+ odoo_addon_openupgrade_scripts-16.0.1.0.3.166.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
644
+ odoo_addon_openupgrade_scripts-16.0.1.0.3.166.dist-info/RECORD,,