odoo-addon-openupgrade-scripts 17.0.1.0.1.368__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.
- odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/end-migration.py +20 -0
- odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/post-migration.py +73 -0
- odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/pre-migration.py +39 -0
- odoo/addons/openupgrade_scripts/scripts/base_automation/17.0.1.0/upgrade_analysis_work.txt +33 -0
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.368.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info}/METADATA +1 -1
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.368.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info}/RECORD +8 -4
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.368.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info}/WHEEL +0 -0
- {odoo_addon_openupgrade_scripts-17.0.1.0.1.368.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.370.dist-info}/top_level.txt +0 -0
@@ -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
|
@@ -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
|
@@ -774,7 +778,7 @@ odoo/addons/openupgrade_scripts/scripts/website_twitter/17.0.1.0/upgrade_analysi
|
|
774
778
|
odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
|
775
779
|
odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
776
780
|
odoo/addons/openupgrade_scripts/static/description/index.html,sha256=iV41-zYBM4uvZPuunpcr7bQeRgBaojVsKo_gkeyJyA4,12639
|
777
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
778
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
779
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
780
|
-
odoo_addon_openupgrade_scripts-17.0.1.0.1.
|
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,,
|
File without changes
|