odoo-addon-automation-oca 16.0.1.4.1__py3-none-any.whl → 16.0.1.5.0__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/automation_oca/README.rst +1 -1
- odoo/addons/automation_oca/__manifest__.py +1 -1
- odoo/addons/automation_oca/i18n/automation_oca.pot +13 -0
- odoo/addons/automation_oca/models/automation_configuration_step.py +11 -0
- odoo/addons/automation_oca/models/automation_record_step.py +6 -1
- odoo/addons/automation_oca/static/description/index.html +1 -1
- odoo/addons/automation_oca/tests/test_automation_action.py +14 -0
- odoo/addons/automation_oca/tests/test_automation_base.py +4 -0
- odoo/addons/automation_oca/views/automation_configuration_step.xml +5 -0
- {odoo_addon_automation_oca-16.0.1.4.1.dist-info → odoo_addon_automation_oca-16.0.1.5.0.dist-info}/METADATA +2 -2
- {odoo_addon_automation_oca-16.0.1.4.1.dist-info → odoo_addon_automation_oca-16.0.1.5.0.dist-info}/RECORD +13 -13
- {odoo_addon_automation_oca-16.0.1.4.1.dist-info → odoo_addon_automation_oca-16.0.1.5.0.dist-info}/WHEEL +0 -0
- {odoo_addon_automation_oca-16.0.1.4.1.dist-info → odoo_addon_automation_oca-16.0.1.5.0.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ Automation Oca
|
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
|
8
8
|
!! changes will be overwritten. !!
|
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
10
|
-
!! source digest: sha256:
|
|
10
|
+
!! source digest: sha256:96db185a63948bc38bae9817bdd52f2493c9aa238b2e8df392be09b9eabae6e2
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -1194,9 +1194,22 @@ msgstr ""
|
|
|
1194
1194
|
#. module: automation_oca
|
|
1195
1195
|
#: model:ir.model.fields,field_description:automation_oca.field_automation_configuration_step__server_action_id
|
|
1196
1196
|
#: model:ir.model.fields.selection,name:automation_oca.selection__automation_configuration_step__step_type__action
|
|
1197
|
+
#: model_terms:ir.ui.view,arch_db:automation_oca.automation_configuration_step_form_view
|
|
1197
1198
|
msgid "Server Action"
|
|
1198
1199
|
msgstr ""
|
|
1199
1200
|
|
|
1201
|
+
#. module: automation_oca
|
|
1202
|
+
#: model:ir.model.fields,field_description:automation_oca.field_automation_configuration_step__server_context
|
|
1203
|
+
msgid "Server Context"
|
|
1204
|
+
msgstr ""
|
|
1205
|
+
|
|
1206
|
+
#. module: automation_oca
|
|
1207
|
+
#. odoo-python
|
|
1208
|
+
#: code:addons/automation_oca/models/automation_configuration_step.py:0
|
|
1209
|
+
#, python-format
|
|
1210
|
+
msgid "Server Context is not wellformed"
|
|
1211
|
+
msgstr ""
|
|
1212
|
+
|
|
1200
1213
|
#. module: automation_oca
|
|
1201
1214
|
#: model:ir.model.fields,help:automation_oca.field_automation_configuration_step__trigger_interval
|
|
1202
1215
|
msgid ""
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Copyright 2024 Dixmit
|
|
2
2
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
3
|
|
|
4
|
+
import json
|
|
4
5
|
from collections import defaultdict
|
|
5
6
|
|
|
6
7
|
import babel.dates
|
|
@@ -77,6 +78,7 @@ class AutomationConfigurationStep(models.Model):
|
|
|
77
78
|
server_action_id = fields.Many2one(
|
|
78
79
|
"ir.actions.server", domain="[('model_id', '=', model_id)]"
|
|
79
80
|
)
|
|
81
|
+
server_context = fields.Text(default="{}")
|
|
80
82
|
activity_type_id = fields.Many2one(
|
|
81
83
|
"mail.activity.type",
|
|
82
84
|
string="Activity",
|
|
@@ -136,6 +138,15 @@ class AutomationConfigurationStep(models.Model):
|
|
|
136
138
|
graph_done = fields.Integer(compute="_compute_total_graph_data")
|
|
137
139
|
graph_error = fields.Integer(compute="_compute_total_graph_data")
|
|
138
140
|
|
|
141
|
+
@api.constrains("server_context")
|
|
142
|
+
def _check_server_context(self):
|
|
143
|
+
for record in self:
|
|
144
|
+
if record.server_context:
|
|
145
|
+
try:
|
|
146
|
+
json.loads(record.server_context)
|
|
147
|
+
except Exception as e:
|
|
148
|
+
raise ValidationError(_("Server Context is not wellformed")) from e
|
|
149
|
+
|
|
139
150
|
@api.onchange("trigger_type")
|
|
140
151
|
def _onchange_trigger_type(self):
|
|
141
152
|
if self.trigger_type == "start":
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Copyright 2024 Dixmit
|
|
2
2
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
+
import json
|
|
3
4
|
import threading
|
|
4
5
|
import traceback
|
|
5
6
|
from io import StringIO
|
|
@@ -165,7 +166,7 @@ class AutomationRecordStep(models.Model):
|
|
|
165
166
|
self.record_id.resource_ref,
|
|
166
167
|
parent_id=self.id,
|
|
167
168
|
record_id=self.record_id.id,
|
|
168
|
-
**kwargs
|
|
169
|
+
**kwargs,
|
|
169
170
|
)
|
|
170
171
|
for activity in self.configuration_step_id.child_ids
|
|
171
172
|
]
|
|
@@ -244,7 +245,11 @@ class AutomationRecordStep(models.Model):
|
|
|
244
245
|
return {}
|
|
245
246
|
|
|
246
247
|
def _run_action(self):
|
|
248
|
+
context = {}
|
|
249
|
+
if self.configuration_step_id.server_context:
|
|
250
|
+
context.update(json.loads(self.configuration_step_id.server_context))
|
|
247
251
|
self.configuration_step_id.server_action_id.with_context(
|
|
252
|
+
**context,
|
|
248
253
|
active_model=self.record_id.model,
|
|
249
254
|
active_ids=[self.record_id.res_id],
|
|
250
255
|
).run()
|
|
@@ -367,7 +367,7 @@ ul.auto-toc {
|
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
|
368
368
|
!! changes will be overwritten. !!
|
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
370
|
-
!! source digest: sha256:
|
|
370
|
+
!! source digest: sha256:96db185a63948bc38bae9817bdd52f2493c9aa238b2e8df392be09b9eabae6e2
|
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
|
372
372
|
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/automation/tree/16.0/automation_oca"><img alt="OCA/automation" src="https://img.shields.io/badge/github-OCA%2Fautomation-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/automation-16-0/automation-16-0-automation_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/automation&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
|
373
373
|
<p>This module allows to automate several process according to some rules.</p>
|
|
@@ -219,3 +219,17 @@ class TestAutomationAction(AutomationTestCase):
|
|
|
219
219
|
]
|
|
220
220
|
),
|
|
221
221
|
)
|
|
222
|
+
|
|
223
|
+
def test_context(self):
|
|
224
|
+
"""
|
|
225
|
+
We will check that the context is modified and passed on server actions
|
|
226
|
+
"""
|
|
227
|
+
self.create_server_action(server_context='{"key_value": "My Value"}')
|
|
228
|
+
self.partner_01.comment = False
|
|
229
|
+
self.configuration.editable_domain = "[('id', '=', %s)]" % self.partner_01.id
|
|
230
|
+
self.configuration.start_automation()
|
|
231
|
+
self.env["automation.configuration"].cron_automation()
|
|
232
|
+
|
|
233
|
+
self.assertFalse(self.partner_01.comment)
|
|
234
|
+
self.env["automation.record.step"]._cron_automation_steps()
|
|
235
|
+
self.assertIn("My Value", self.partner_01.comment)
|
|
@@ -485,6 +485,10 @@ class TestAutomationBase(AutomationTestCase):
|
|
|
485
485
|
with self.assertRaises(ValidationError):
|
|
486
486
|
self.create_server_action(parent_id=False, trigger_type="after_step")
|
|
487
487
|
|
|
488
|
+
def test_constrains_wrong_context(self):
|
|
489
|
+
with self.assertRaises(ValidationError):
|
|
490
|
+
self.create_server_action(server_context="{not a json}")
|
|
491
|
+
|
|
488
492
|
def test_is_test_behavior(self):
|
|
489
493
|
"""
|
|
490
494
|
We want to ensure that no mails are sent on tests
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-automation_oca
|
|
3
|
-
Version: 16.0.1.
|
|
3
|
+
Version: 16.0.1.5.0
|
|
4
4
|
Summary: Automate actions in threaded models
|
|
5
5
|
Home-page: https://github.com/OCA/automation
|
|
6
6
|
Author: Dixmit,Odoo Community Association (OCA)
|
|
@@ -22,7 +22,7 @@ Automation Oca
|
|
|
22
22
|
!! This file is generated by oca-gen-addon-readme !!
|
|
23
23
|
!! changes will be overwritten. !!
|
|
24
24
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
25
|
-
!! source digest: sha256:
|
|
25
|
+
!! source digest: sha256:96db185a63948bc38bae9817bdd52f2493c9aa238b2e8df392be09b9eabae6e2
|
|
26
26
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
27
|
|
|
28
28
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
odoo/addons/automation_oca/README.rst,sha256=
|
|
1
|
+
odoo/addons/automation_oca/README.rst,sha256=rFqq-2ZwIaH4dNx_ARW2sED2yAI3sKZXSTnV2_89sTE,6962
|
|
2
2
|
odoo/addons/automation_oca/__init__.py,sha256=dnUeA_K1torbiMNF3tt2dtECdk-FkWm01DByr9MBMIA,69
|
|
3
|
-
odoo/addons/automation_oca/__manifest__.py,sha256=
|
|
3
|
+
odoo/addons/automation_oca/__manifest__.py,sha256=SNe9ni9gZ7cidB81HD1T5rT58tSCXKEzX2xtTk5ZpRw,1181
|
|
4
4
|
odoo/addons/automation_oca/controllers/__init__.py,sha256=4KFqEP2QHFbPN66eQJMdGsmNz2v7ywWv_FR1pW_kkLk,19
|
|
5
5
|
odoo/addons/automation_oca/controllers/main.py,sha256=DRL6AJKy18ekRPaKtmRoEh5i6fNQDWpoq2GTHztKOKI,2355
|
|
6
6
|
odoo/addons/automation_oca/data/cron.xml,sha256=viAGNb5X619yXQyfpO_HcJOAiQGzEE-m6Sp4y6F4gDs,1297
|
|
7
7
|
odoo/addons/automation_oca/demo/demo.xml,sha256=beyrfyRzVTDZ1Mm2sL5Y57W4GDsUvj9gOMUlrEMM1M8,2838
|
|
8
|
-
odoo/addons/automation_oca/i18n/automation_oca.pot,sha256=
|
|
8
|
+
odoo/addons/automation_oca/i18n/automation_oca.pot,sha256=GT-2I6Zr-uwaLgX0uMeJbfJUWoYSbJNkvmuEYagSNyI,52559
|
|
9
9
|
odoo/addons/automation_oca/i18n/es.po,sha256=5VzQc6KtnVwyJfwHknZSXbrTlex65CQCPShT4lgDETg,58907
|
|
10
10
|
odoo/addons/automation_oca/i18n/fr.po,sha256=4MD-Lfy-6uAKKPueMwkTwN0MyNEFklVo8G2rx7IlK0E,55691
|
|
11
11
|
odoo/addons/automation_oca/i18n/it.po,sha256=myPKwWtTm6Xp9pwT3cZc_b8SOTuwFBazCQdZRY3LkVY,58633
|
|
12
12
|
odoo/addons/automation_oca/models/__init__.py,sha256=gRWvgicyFDELSeVnpRow1mGuWjfm3ima2Lo-NqlymKg,318
|
|
13
13
|
odoo/addons/automation_oca/models/automation_configuration.py,sha256=VaWXg_6EnUnTdLDV_eZnWKXXVU27nGmZR_lnGIeKstA,12086
|
|
14
|
-
odoo/addons/automation_oca/models/automation_configuration_step.py,sha256=
|
|
14
|
+
odoo/addons/automation_oca/models/automation_configuration_step.py,sha256=euIPXQ8OFPPLKJrxSUbyQJQqdj9jo1rh8_mdbHYpZOs,20752
|
|
15
15
|
odoo/addons/automation_oca/models/automation_filter.py,sha256=W8VM977yXH_hZUKCO8ZDKsvzIjYegoIGMN1QLEvikOY,706
|
|
16
16
|
odoo/addons/automation_oca/models/automation_record.py,sha256=LYZ1fkijB2R3QjBoJN_gnsPzqjkp-Gk_6LyPywMQAQA,7172
|
|
17
|
-
odoo/addons/automation_oca/models/automation_record_step.py,sha256=
|
|
17
|
+
odoo/addons/automation_oca/models/automation_record_step.py,sha256=d1rjTe89CR1hQ3AXT3u7iKHDaGhRmi-LvceFcUA3Ba4,16217
|
|
18
18
|
odoo/addons/automation_oca/models/automation_tag.py,sha256=mIsuTsLQv8ZLLdykBmvLQ6fLKHJMKZ8qfAwaVibw78c,488
|
|
19
19
|
odoo/addons/automation_oca/models/link_tracker.py,sha256=F8TxTsq5Mzd1H18RygZn4YDjZs8WIPO-B9o1EhaADYg,1745
|
|
20
20
|
odoo/addons/automation_oca/models/mail_activity.py,sha256=OTC8RJ3ZYMPFGixMmIWFPNzHi110trdadf7GVFoulQ0,841
|
|
@@ -29,7 +29,7 @@ odoo/addons/automation_oca/security/security.xml,sha256=pT37-cLbQIP--Tzp0fljiyvN
|
|
|
29
29
|
odoo/addons/automation_oca/static/description/configuration.png,sha256=W8cAn7-cQEVhf7Zy979xMDHi1cKWbDH7uyWkjvGi9gc,55863
|
|
30
30
|
odoo/addons/automation_oca/static/description/icon.png,sha256=abhQ1HbvsatZ_WVS_G6qroJgWNa1Hppd961RD7vrAug,37729
|
|
31
31
|
odoo/addons/automation_oca/static/description/icon.svg,sha256=NkJAwQ9YAXML6VIKe90VZzKUZb58-zGNL029-GC8Pm4,4641
|
|
32
|
-
odoo/addons/automation_oca/static/description/index.html,sha256=
|
|
32
|
+
odoo/addons/automation_oca/static/description/index.html,sha256=HPyDpdG5Akzs9K3_Yp37GRLSeoc4ANHOGjCjjCaHrqQ,18215
|
|
33
33
|
odoo/addons/automation_oca/static/src/fields/automation_activity/automation_activity.esm.js,sha256=pbzjSHVYdYcMOXzXtC-lyVYrydk_1YRtMVh88XpTo-E,1779
|
|
34
34
|
odoo/addons/automation_oca/static/src/fields/automation_graph/automation_graph.esm.js,sha256=vbPRaNzH1_wbB0gEBhZvm0gT0VXdgtElQIYeAOJZuNM,3214
|
|
35
35
|
odoo/addons/automation_oca/static/src/fields/automation_graph/automation_graph.xml,sha256=86VqoFswW3ZppaR0KFG4_giKPeT8vgdC1A1vpBtPjFk,297
|
|
@@ -39,13 +39,13 @@ odoo/addons/automation_oca/static/src/views/automation_kanban/automation_kanban_
|
|
|
39
39
|
odoo/addons/automation_oca/static/src/views/automation_kanban/automation_kanban_renderer.esm.js,sha256=GjwEFRuQeP6FKie_ODYaqxvv_pYDsj8STWkFtlR3Ki8,1197
|
|
40
40
|
odoo/addons/automation_oca/tests/__init__.py,sha256=5VS2h2Hl3gUzMQqKgPUYnq-_Wkk7SfD_k0YgTsfXj3g,185
|
|
41
41
|
odoo/addons/automation_oca/tests/common.py,sha256=Zu5AcWGMgoDKdsQ4VMyhHTnot1f7Hunh4tDH9CSHbXw,3558
|
|
42
|
-
odoo/addons/automation_oca/tests/test_automation_action.py,sha256=
|
|
42
|
+
odoo/addons/automation_oca/tests/test_automation_action.py,sha256=GT7Kja9l1Z-9MzWhKPuDc1a5-IkdHNgABtNVX50Sr24,8994
|
|
43
43
|
odoo/addons/automation_oca/tests/test_automation_activity.py,sha256=OLJs-D3hAUzVHX8EtnEE4_1e5XIJQ2JVoFrlpSA52Ls,10549
|
|
44
|
-
odoo/addons/automation_oca/tests/test_automation_base.py,sha256=
|
|
44
|
+
odoo/addons/automation_oca/tests/test_automation_base.py,sha256=nk5GwIozwX0uHjn6LIum36zphR9VDJdZ7VpbgTahLlE,25536
|
|
45
45
|
odoo/addons/automation_oca/tests/test_automation_mail.py,sha256=zOzRfhH0-Zz0Jm1TX15efgXibjj7Au19597DZWvAQGc,24704
|
|
46
46
|
odoo/addons/automation_oca/tests/test_automation_security.py,sha256=iazrh9TJDCLaK1vXKXMNqBf0bizedBd3QxUwCodjesY,3883
|
|
47
47
|
odoo/addons/automation_oca/views/automation_configuration.xml,sha256=VU_Hn1cOjZ_z8MbCAgareo3K1PNof0krjW7Nrz90FYQ,25986
|
|
48
|
-
odoo/addons/automation_oca/views/automation_configuration_step.xml,sha256=
|
|
48
|
+
odoo/addons/automation_oca/views/automation_configuration_step.xml,sha256=x2ZfzH1xa4lk4Sz8CSxpThFvhWDws7QrInZnp69CftE,9936
|
|
49
49
|
odoo/addons/automation_oca/views/automation_filter.xml,sha256=Mx0SBoVk2U3QY-hseKymbOphlK-hOjHdFzLtPgU2jok,2271
|
|
50
50
|
odoo/addons/automation_oca/views/automation_record.xml,sha256=gFpChe7depWuZS751R3TLC1B4IxzVW5ez2yp-a9VPck,16034
|
|
51
51
|
odoo/addons/automation_oca/views/automation_record_step.xml,sha256=cBao3BLIo9Db_Mv4VpyugpnTfzMmjLXQ5Eu2aYwD9uE,5263
|
|
@@ -56,7 +56,7 @@ odoo/addons/automation_oca/wizards/__init__.py,sha256=1yOQpQirzOswywec7gg_gshvEP
|
|
|
56
56
|
odoo/addons/automation_oca/wizards/automation_configuration_test.py,sha256=YK0HD6Ds6B4PMaI97MUpVQaB-wsVTmw6Hpbh532tU-g,1363
|
|
57
57
|
odoo/addons/automation_oca/wizards/automation_configuration_test.xml,sha256=r9lUzD3SeFSLStlc07iXxO1b9e9RbZdUCrvMA46zfm8,1916
|
|
58
58
|
odoo/addons/automation_oca/wizards/mail_compose_message.py,sha256=XL6UGz8_fEwniXM80DhQXink4SMnWg7HHR0kHLekMyc,612
|
|
59
|
-
odoo_addon_automation_oca-16.0.1.
|
|
60
|
-
odoo_addon_automation_oca-16.0.1.
|
|
61
|
-
odoo_addon_automation_oca-16.0.1.
|
|
62
|
-
odoo_addon_automation_oca-16.0.1.
|
|
59
|
+
odoo_addon_automation_oca-16.0.1.5.0.dist-info/METADATA,sha256=OZuLGlQZPWe5k6Q6VFsaWQwPX7umdAYcZyoB3omfgb8,7479
|
|
60
|
+
odoo_addon_automation_oca-16.0.1.5.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
61
|
+
odoo_addon_automation_oca-16.0.1.5.0.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
62
|
+
odoo_addon_automation_oca-16.0.1.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|