odoo-addon-openupgrade-scripts 17.0.1.0.1.363__py3-none-any.whl → 17.0.1.0.1.370__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,20 @@
1
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2
+ from openupgradelib import openupgrade
3
+
4
+
5
+ def _ir_act_server_update_name_if_base_automation(env):
6
+ langs = env["res.lang"].search([]).mapped("code")
7
+
8
+ act_servers = (
9
+ env["ir.actions.server"]
10
+ .with_context(active_test=False)
11
+ .search([("base_automation_id", "!=", False)])
12
+ )
13
+ if act_servers:
14
+ for lang in langs:
15
+ act_servers.with_context(lang=lang)._compute_name()
16
+
17
+
18
+ @openupgrade.migrate()
19
+ def migrate(env, version):
20
+ _ir_act_server_update_name_if_base_automation(env)
@@ -0,0 +1,73 @@
1
+ # Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+ from openupgradelib import openupgrade
4
+
5
+
6
+ def _base_automation_update_trigger_fields_ids_if_null(env):
7
+ """
8
+ Need to update the trigger_fields_ids if Null for 'on_create_or_write'
9
+ or else we will get weird error
10
+ Also this is base on hint from
11
+ https://github.com/odoo/odoo/pull/114352#issuecomment-1836948745
12
+ """
13
+ base_automations = (
14
+ env["base.automation"]
15
+ .with_context(active_test=False)
16
+ .search(
17
+ [
18
+ ("trigger", "=", "on_create"),
19
+ ("trigger_field_ids", "=", False),
20
+ ]
21
+ )
22
+ )
23
+ if base_automations:
24
+ create_date_fields = env["ir.model.fields"].search(
25
+ [
26
+ ("model_id", "in", tuple(base_automations.model_id.ids)),
27
+ ("name", "=", "create_date"),
28
+ ]
29
+ )
30
+ for automation in base_automations:
31
+ create_date_field = create_date_fields.filtered(
32
+ lambda field, automation=automation: field.model_id
33
+ == automation.model_id
34
+ )[:1]
35
+ if create_date_field:
36
+ automation.trigger_field_ids = [(4, create_date_field.id)]
37
+
38
+
39
+ def _ir_ui_view_remove_inherit_id_from_automation_form(env):
40
+ """
41
+ Somehow this inherit_id from ir.actions.server of 'view_base_automation_form'
42
+ won't disappear so we need to remove it from here
43
+ """
44
+ view = env.ref(
45
+ "base_automation.view_base_automation_form", raise_if_not_found=False
46
+ )
47
+ if view and view.inherit_id:
48
+ view.inherit_id = False
49
+
50
+
51
+ def _ir_act_server_update_base_automation_id(env):
52
+ openupgrade.m2o_to_x2m(
53
+ env.cr,
54
+ env["base.automation"],
55
+ "base_automation",
56
+ "action_server_ids",
57
+ "action_server_id",
58
+ )
59
+
60
+
61
+ def _base_automation_rotate_webhook_uuid(env):
62
+ env["base.automation"].with_context(active_test=False).search(
63
+ []
64
+ ).action_rotate_webhook_uuid()
65
+
66
+
67
+ @openupgrade.migrate()
68
+ def migrate(env, version):
69
+ openupgrade.load_data(env, "base_automation", "17.0.1.0/noupdate_changes.xml")
70
+ _base_automation_update_trigger_fields_ids_if_null(env)
71
+ _ir_ui_view_remove_inherit_id_from_automation_form(env)
72
+ _ir_act_server_update_base_automation_id(env)
73
+ _base_automation_rotate_webhook_uuid(env)
@@ -0,0 +1,39 @@
1
+ # Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+ from openupgradelib import openupgrade
4
+
5
+
6
+ def _base_automation_create_compute_fields(env):
7
+ _new_columns = [
8
+ ("base.automation", "trg_field_ref", "many2one_reference"),
9
+ ("base.automation", "trg_selection_field_id", "many2one"),
10
+ ]
11
+
12
+ openupgrade.add_columns(env, _new_columns)
13
+
14
+
15
+ def _base_automation_sync_from_ir_act_server(env):
16
+ openupgrade.logged_query(
17
+ env.cr,
18
+ """
19
+ ALTER TABLE base_automation
20
+ ADD COLUMN IF NOT EXISTS model_id INTEGER,
21
+ ADD COLUMN IF NOT EXISTS name JSONB;
22
+ """,
23
+ )
24
+ openupgrade.logged_query(
25
+ env.cr,
26
+ """
27
+ UPDATE base_automation ba
28
+ SET model_id = ias.model_id,
29
+ name = ias.name
30
+ FROM ir_act_server ias
31
+ WHERE ba.action_server_id = ias.id
32
+ """,
33
+ )
34
+
35
+
36
+ @openupgrade.migrate()
37
+ def migrate(env, version):
38
+ _base_automation_create_compute_fields(env)
39
+ _base_automation_sync_from_ir_act_server(env)
@@ -0,0 +1,33 @@
1
+ ---Models in module 'base_automation'---
2
+ ---Fields in module 'base_automation'---
3
+ base_automation / base.automation / _order : _order is now 'id' ('sequence')
4
+ base_automation / base.automation / description (html) : NEW
5
+ base_automation / base.automation / log_webhook_calls (boolean) : NEW hasdefault: default
6
+ base_automation / base.automation / record_getter (char) : NEW hasdefault: default
7
+ base_automation / base.automation / trigger (selection) : selection_keys is now '['on_archive', 'on_change', 'on_create', 'on_create_or_write', 'on_message_received', 'on_message_sent', 'on_priority_set', 'on_stage_set', 'on_state_set', 'on_tag_set', 'on_time', 'on_time_created', 'on_time_updated', 'on_unarchive', 'on_unlink', 'on_user_set', 'on_webhook', 'on_write']' ('['on_change', 'on_create', 'on_create_or_write', 'on_time', 'on_unlink', 'on_write']')
8
+ # NOTHING TO DO
9
+
10
+ base_automation / base.automation / model_id (many2one) : is now stored
11
+ base_automation / base.automation / model_id (many2one) : not related anymore
12
+ base_automation / base.automation / name (char) : is now stored
13
+ base_automation / base.automation / name (char) : not related anymore
14
+ base_automation / base.automation / trg_field_ref (many2one_reference): NEW relation: trg_field_ref_model_name, hasdefault: compute
15
+ base_automation / base.automation / trg_selection_field_id (many2one): NEW relation: ir.model.fields.selection, hasdefault: compute
16
+ # DONE pre-migration: create column and fill value
17
+
18
+ base_automation / base.automation / _inherits : DEL _inherits: {'ir.actions.server': 'action_server_id'}
19
+ base_automation / base.automation / action_server_id (many2one) : DEL relation: ir.actions.server, required
20
+ base_automation / base.automation / action_server_ids (one2many) : NEW relation: ir.actions.server, hasdefault: compute
21
+ base_automation / ir.actions.server / base_automation_id (many2one) : NEW relation: base.automation
22
+ # DONE post-migration: convert m2o to o2m by filling base_automation_id for ir.action.servers
23
+
24
+ base_automation / base.automation / webhook_uuid (char) : NEW
25
+ # DONE post-migration: rotate uuid to get a distinct uuid per record
26
+
27
+ base_automation / ir.actions.server / name (False) : NEW mode: modify, hasdefault: compute
28
+ # DONE end-migration: update name for action that is related to automation using ORM to support translation
29
+
30
+ ---XML records in module 'base_automation'---
31
+ NEW ir.ui.view: base_automation.ir_actions_server_view_form_automation
32
+ NEW ir.ui.view: base_automation.view_base_automation_kanban
33
+ # NOTHING TO DO
@@ -0,0 +1,34 @@
1
+ # Copyright 2025 Tecnativa - Carlos Lopez
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+ from openupgradelib import openupgrade
4
+
5
+
6
+ def _fill_microsoft_calendar_credentials_res_users(env):
7
+ openupgrade.logged_query(
8
+ env.cr,
9
+ """
10
+ INSERT INTO microsoft_calendar_credentials (
11
+ create_uid, write_uid, create_date, write_date,
12
+ calendar_sync_token, synchronization_stopped
13
+ )
14
+ SELECT id, id, create_date, write_date,
15
+ microsoft_calendar_sync_token, microsoft_synchronization_stopped
16
+ FROM res_users
17
+ WHERE microsoft_calendar_sync_token IS NOT NULL
18
+ """,
19
+ )
20
+ openupgrade.logged_query(
21
+ env.cr,
22
+ """
23
+ UPDATE res_users ru
24
+ SET microsoft_calendar_account_id = mc.id
25
+ FROM microsoft_calendar_credentials mc
26
+ WHERE mc.calendar_sync_token = ru.microsoft_calendar_sync_token
27
+ AND ru.microsoft_calendar_account_id IS NULL
28
+ """,
29
+ )
30
+
31
+
32
+ @openupgrade.migrate()
33
+ def migrate(env, version=None):
34
+ _fill_microsoft_calendar_credentials_res_users(env)
@@ -0,0 +1,24 @@
1
+ ---Models in module 'microsoft_calendar'---
2
+ new model microsoft.calendar.credentials
3
+ ---Fields in module 'microsoft_calendar'---
4
+ microsoft_calendar / microsoft.calendar.credentials / calendar_sync_token (char) : NEW
5
+ microsoft_calendar / microsoft.calendar.credentials / last_sync_date (datetime) : NEW
6
+ microsoft_calendar / microsoft.calendar.credentials / synchronization_stopped (boolean): NEW
7
+ microsoft_calendar / microsoft.calendar.credentials / user_ids (one2many) : NEW relation: res.users, required
8
+ microsoft_calendar / res.users / microsoft_calendar_account_id (many2one): NEW relation: microsoft.calendar.credentials
9
+ # DONE: post-migration: Populate the table with user information
10
+
11
+ microsoft_calendar / res.users / microsoft_calendar_sync_token (char): not stored anymore
12
+ microsoft_calendar / res.users / microsoft_calendar_sync_token (char): now related
13
+ microsoft_calendar / res.users / microsoft_synchronization_stopped (boolean): not stored anymore
14
+ microsoft_calendar / res.users / microsoft_synchronization_stopped (boolean): now related
15
+ # NOTHING TO DO: Handled by the ORM
16
+
17
+ ---XML records in module 'microsoft_calendar'---
18
+ NEW ir.model.access: microsoft_calendar.access_microsoft_calendar_credentials
19
+ NEW ir.model.access: microsoft_calendar.microsoft_calendar_manager
20
+ NEW ir.model.constraint: microsoft_calendar.constraint_res_users_microsoft_token_uniq
21
+ NEW ir.rule: microsoft_calendar.microsoft_calendar_not_own_token_rule (noupdate)
22
+ NEW ir.rule: microsoft_calendar.microsoft_calendar_own_token_rule (noupdate)
23
+ NEW ir.rule: microsoft_calendar.microsoft_calendar_token_system_access (noupdate)
24
+ # NOTHING TO DO: Handled by the ORM
@@ -0,0 +1,12 @@
1
+ ---Models in module 'website_livechat'---
2
+ ---Fields in module 'website_livechat'---
3
+ website_livechat / website.visitor / discuss_channel_ids (one2many): NEW relation: discuss.channel
4
+ website_livechat / website.visitor / mail_channel_ids (one2many) : DEL relation: mail.channel
5
+ # NOTHING TO DO: Renaming was done in the mail module.
6
+
7
+ ---XML records in module 'website_livechat'---
8
+ NEW ir.model.access: website_livechat.access_im_livechat_channel_public_employee
9
+ NEW ir.model.access: website_livechat.access_im_livechat_channel_public_portal
10
+ NEW ir.model.access: website_livechat.access_im_livechat_channel_public_public
11
+ DEL ir.model.access: website_livechat.access_im_livechat_channel_public
12
+ # NOTHING TO DO: Handled by the ORM
@@ -0,0 +1,8 @@
1
+ ---Models in module 'website_twitter'---
2
+ ---Fields in module 'website_twitter'---
3
+ ---XML records in module 'website_twitter'---
4
+ NEW ir.model.access: website_twitter.access_website_twitter_tweet_public_employee
5
+ NEW ir.model.access: website_twitter.access_website_twitter_tweet_public_portal
6
+ NEW ir.model.access: website_twitter.access_website_twitter_tweet_public_public
7
+ DEL ir.model.access: website_twitter.access_website_twitter_tweet_public
8
+ # NOTHING TO DO: Handled by the ORM
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade_scripts
3
- Version: 17.0.1.0.1.363
3
+ Version: 17.0.1.0.1.370
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: odoo>=17.0a,<17.1dev
6
6
  Requires-Dist: openupgradelib
@@ -65,8 +65,12 @@ odoo/addons/openupgrade_scripts/scripts/base/17.0.1.3/upgrade_analysis_work.txt,
65
65
  odoo/addons/openupgrade_scripts/scripts/base/17.0.1.3/upgrade_general_log.txt,sha256=oa_zSP29akGa7Y9X5Xhx9Lw3mCV5ZBZRlz2gK78Rz70,37112
66
66
  odoo/addons/openupgrade_scripts/scripts/base_address_extended/17.0.1.1/upgrade_analysis.txt,sha256=ASu66ZAbmDdq4hDHw_jHbavco76PjR0kFfvKSZ0bSI4,198
67
67
  odoo/addons/openupgrade_scripts/scripts/base_address_extended/17.0.1.1/upgrade_analysis_work.txt,sha256=nruG5RgW_s2oRSAhmg_oeNdsAdehnW4SbI856Lm-3Sg,214
68
+ odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/end-migration.py,sha256=4cx-G_E1OzVpwxJxiZjRlG1I1qaO6VJpVTaRPz-IEbY,590
68
69
  odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/noupdate_changes.xml,sha256=JUepQ4WdQ8g01-jvRxEW2ZEl_jjZWqyCUGu6wU6DutI,200
70
+ odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/post-migration.py,sha256=pcahgpHNqCiooOHlvFYbWfbaJncxmQr9dcL3Y9ZBqck,2418
71
+ odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/pre-migration.py,sha256=hq0C7IRK_Nbbh4jg37Z6ZvoTkOsRntsghwI0PUAbZgI,1109
69
72
  odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/upgrade_analysis.txt,sha256=HnBmJd91LSYEPhwYRffQFxA5-v4YvON5WlATvJzUJiQ,2474
73
+ odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/upgrade_analysis_work.txt,sha256=m7-5hu70MaOKLqAePCSOhDZJkgT1wwqAG64Yy5kUIfM,2833
70
74
  odoo/addons/openupgrade_scripts/scripts/base_geolocalize/17.0.2.1/upgrade_analysis.txt,sha256=Bm_lKaW84WXUAyI49HewdVmRG2HmHhLEP2xz5_e7t6M,187
71
75
  odoo/addons/openupgrade_scripts/scripts/base_geolocalize/17.0.2.1/upgrade_analysis_work.txt,sha256=WGIneZMgMUWD5Bqzu6S0iZhVDgAaISS3q9xjIIWKUMg,203
72
76
  odoo/addons/openupgrade_scripts/scripts/base_import/17.0.2.0/upgrade_analysis.txt,sha256=_u8p6w0pKHUhdUA_nsWTKTEdeGDWhQpFtIS9YOMG5xE,4560
@@ -439,7 +443,9 @@ odoo/addons/openupgrade_scripts/scripts/membership/17.0.1.0/pre-migration.py,sha
439
443
  odoo/addons/openupgrade_scripts/scripts/membership/17.0.1.0/upgrade_analysis.txt,sha256=j4vniS-JNd5XTKN4pvbd3etahcJmn8zMcs7ATL8awGY,300
440
444
  odoo/addons/openupgrade_scripts/scripts/membership/17.0.1.0/upgrade_analysis_work.txt,sha256=r7qp2tiAAlJhVLKVq-9i1H01K9YffWGX-szRLwN_4AQ,354
441
445
  odoo/addons/openupgrade_scripts/scripts/microsoft_account/17.0.1.0/upgrade_analysis.txt,sha256=A-hAfz4jaf1_-Uw2-6JP4inCGDe6LXPvVvXb7Dk9Nyc,174
446
+ odoo/addons/openupgrade_scripts/scripts/microsoft_calendar/17.0.1.0/post-migration.py,sha256=-cKhyRHLDdDHLAIDD0gHi-h8ZDmRqSu0x5Tp-unpjVQ,1114
442
447
  odoo/addons/openupgrade_scripts/scripts/microsoft_calendar/17.0.1.0/upgrade_analysis.txt,sha256=EHFEvy7AiiO0ZtkXFxTv4k_pjvLONtoHy_-lF_Ufou0,1597
448
+ odoo/addons/openupgrade_scripts/scripts/microsoft_calendar/17.0.1.0/upgrade_analysis_work.txt,sha256=5zrf7UVq-Kkt0yGX8MNLrWoH3K9timioaSuW0Ks5OK0,1736
443
449
  odoo/addons/openupgrade_scripts/scripts/microsoft_outlook/17.0.1.1/upgrade_analysis.txt,sha256=AN9OrdoYh8Y4Fk0wPIc2_UuVePoboGlV1VonIbSS1Lk,338
444
450
  odoo/addons/openupgrade_scripts/scripts/microsoft_outlook/17.0.1.1/upgrade_analysis_work.txt,sha256=-374lFqAJ-x8jr2mAvmDSjibdLABaYyEbxavoveOxEc,355
445
451
  odoo/addons/openupgrade_scripts/scripts/mrp/17.0.2.0/post-migration.py,sha256=IuZRbgW5pPDmOCkdOnCfU2DI4lrJ-_jGPRDRaR_kIoE,937
@@ -725,6 +731,7 @@ odoo/addons/openupgrade_scripts/scripts/website_hr_recruitment/17.0.1.1/upgrade_
725
731
  odoo/addons/openupgrade_scripts/scripts/website_hr_recruitment/17.0.1.1/upgrade_analysis_work.txt,sha256=rv3UI_z7rwLVh_ddyvi6X8709hkONmkvSd9kwKu0xp4,908
726
732
  odoo/addons/openupgrade_scripts/scripts/website_jitsi/17.0.1.0/upgrade_analysis.txt,sha256=UzHl2nfT05b9LOrVtS0ZMq1JlSmG2lWMuoMqOk-ib68,162
727
733
  odoo/addons/openupgrade_scripts/scripts/website_livechat/17.0.1.0/upgrade_analysis.txt,sha256=RkBT1gWs5u1IoBdY1YfHR5D9iQ5_e-MSnHCrK427KoY,655
734
+ odoo/addons/openupgrade_scripts/scripts/website_livechat/17.0.1.0/upgrade_analysis_work.txt,sha256=idHo3T4D5Uk9HzCMzWN906-isQMiaMTk8uPABl_SeSU,747
728
735
  odoo/addons/openupgrade_scripts/scripts/website_mass_mailing/17.0.1.0/upgrade_analysis.txt,sha256=c1WE8hDv2O0F3IakOGJfcYwmdEZ8nc11sojJaXBF4-8,203
729
736
  odoo/addons/openupgrade_scripts/scripts/website_mass_mailing/17.0.1.0/upgrade_analysis_work.txt,sha256=S8sm0Z99jDePpCF8KYzXfjztHlM5cW4DKaXQcGd8arg,219
730
737
  odoo/addons/openupgrade_scripts/scripts/website_membership/17.0.1.0/upgrade_analysis work.txt,sha256=ibxBUWpbWu7Ky8i9njDfYXwAnmVRFVXXhsC0YMxZmaQ,360
@@ -767,10 +774,11 @@ odoo/addons/openupgrade_scripts/scripts/website_slides_forum/17.0.1.0/upgrade_an
767
774
  odoo/addons/openupgrade_scripts/scripts/website_slides_survey/17.0.1.0/upgrade_analysis.txt,sha256=9fjMS7VqhSVDSkhRX9OII63hQPg3xrr6OgZkVvy4R4I,210
768
775
  odoo/addons/openupgrade_scripts/scripts/website_slides_survey/17.0.1.0/upgrade_analysis_work.txt,sha256=GlNpEAAygyDfT8ORyRLswh4MtVTJv9VdM2qzAw6N_Pg,226
769
776
  odoo/addons/openupgrade_scripts/scripts/website_twitter/17.0.1.0/upgrade_analysis.txt,sha256=LkD-dmj3O-mCIQ1tlhgb4JpGIQ8_lw_apInOSN8O93o,443
777
+ odoo/addons/openupgrade_scripts/scripts/website_twitter/17.0.1.0/upgrade_analysis_work.txt,sha256=5cpiOakDEpU2d0B5ryUzFTBf1i62oRAsQa4iLYApLeI,479
770
778
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
771
779
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
772
780
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=iV41-zYBM4uvZPuunpcr7bQeRgBaojVsKo_gkeyJyA4,12639
773
- odoo_addon_openupgrade_scripts-17.0.1.0.1.363.dist-info/METADATA,sha256=s0VeClfA7kJRGBA-k85q6hQ1DQr3GmVa0dPS1AFEfJc,3786
774
- odoo_addon_openupgrade_scripts-17.0.1.0.1.363.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
775
- odoo_addon_openupgrade_scripts-17.0.1.0.1.363.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
776
- odoo_addon_openupgrade_scripts-17.0.1.0.1.363.dist-info/RECORD,,
781
+ odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info/METADATA,sha256=BkCJggYd3G7hMiN_rRUCyhk2OVsujmRDtBvT9bJyxQ4,3786
782
+ odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
783
+ odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
784
+ odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info/RECORD,,