odoo-addon-automation-oca 16.0.1.5.2__py3-none-any.whl → 16.0.1.5.3__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/models/mail_activity.py +2 -2
- odoo/addons/automation_oca/static/description/index.html +1 -1
- odoo/addons/automation_oca/tests/test_automation_activity.py +76 -2
- {odoo_addon_automation_oca-16.0.1.5.2.dist-info → odoo_addon_automation_oca-16.0.1.5.3.dist-info}/METADATA +2 -2
- {odoo_addon_automation_oca-16.0.1.5.2.dist-info → odoo_addon_automation_oca-16.0.1.5.3.dist-info}/RECORD +9 -9
- {odoo_addon_automation_oca-16.0.1.5.2.dist-info → odoo_addon_automation_oca-16.0.1.5.3.dist-info}/WHEEL +0 -0
- {odoo_addon_automation_oca-16.0.1.5.2.dist-info → odoo_addon_automation_oca-16.0.1.5.3.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:9989a6bfa92d3f63943ddaa67bbb0ca0b2ebc25419b5ad3231d3841722be0a71
|
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
12
12
|
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -11,7 +11,7 @@ class MailActivity(models.Model):
|
|
|
11
11
|
|
|
12
12
|
def _action_done(self, *args, **kwargs):
|
|
13
13
|
if self.automation_record_step_id:
|
|
14
|
-
self.automation_record_step_id._set_activity_done()
|
|
14
|
+
self.automation_record_step_id.sudo()._set_activity_done()
|
|
15
15
|
return super(
|
|
16
16
|
MailActivity,
|
|
17
17
|
self.with_context(
|
|
@@ -23,5 +23,5 @@ class MailActivity(models.Model):
|
|
|
23
23
|
if self.automation_record_step_id and not self.env.context.get(
|
|
24
24
|
"automation_done"
|
|
25
25
|
):
|
|
26
|
-
self.automation_record_step_id._set_activity_cancel()
|
|
26
|
+
self.automation_record_step_id.sudo()._set_activity_cancel()
|
|
27
27
|
return super(MailActivity, self).unlink()
|
|
@@ -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:9989a6bfa92d3f63943ddaa67bbb0ca0b2ebc25419b5ad3231d3841722be0a71
|
|
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>
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Copyright 2024 Dixmit
|
|
2
2
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
3
|
-
|
|
4
|
-
from odoo.tests import Form
|
|
3
|
+
from odoo.tests import Form, new_test_user
|
|
5
4
|
|
|
6
5
|
from .common import AutomationTestCase
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class TestAutomationActivity(AutomationTestCase):
|
|
9
|
+
@classmethod
|
|
10
|
+
def setUpClass(cls):
|
|
11
|
+
super().setUpClass()
|
|
12
|
+
cls.user = new_test_user(
|
|
13
|
+
cls.env,
|
|
14
|
+
login="test_user_automation",
|
|
15
|
+
groups="base.group_user,base.group_partner_manager",
|
|
16
|
+
)
|
|
17
|
+
|
|
10
18
|
def test_activity_execution(self):
|
|
11
19
|
"""
|
|
12
20
|
We will check the execution of activity tasks (generation of an activity)
|
|
@@ -44,6 +52,43 @@ class TestAutomationActivity(AutomationTestCase):
|
|
|
44
52
|
]
|
|
45
53
|
)
|
|
46
54
|
|
|
55
|
+
def test_activity_execution_permission(self):
|
|
56
|
+
"""
|
|
57
|
+
We will check the execution of activity tasks (generation of an activity)
|
|
58
|
+
"""
|
|
59
|
+
activity = self.create_activity_action()
|
|
60
|
+
self.configuration.editable_domain = "[('id', '=', %s)]" % self.partner_01.id
|
|
61
|
+
self.configuration.start_automation()
|
|
62
|
+
self.env["automation.configuration"].cron_automation()
|
|
63
|
+
self.assertFalse(self.partner_01.activity_ids)
|
|
64
|
+
self.env["automation.record.step"]._cron_automation_steps()
|
|
65
|
+
self.assertTrue(self.partner_01.activity_ids)
|
|
66
|
+
record_activity = self.env["automation.record.step"].search(
|
|
67
|
+
[("configuration_step_id", "=", activity.id)]
|
|
68
|
+
)
|
|
69
|
+
self.assertEqual(
|
|
70
|
+
record_activity, self.partner_01.activity_ids.automation_record_step_id
|
|
71
|
+
)
|
|
72
|
+
self.assertFalse(record_activity.activity_done_on)
|
|
73
|
+
record_activity.invalidate_recordset()
|
|
74
|
+
self.assertFalse(
|
|
75
|
+
[
|
|
76
|
+
step
|
|
77
|
+
for step in record_activity.step_actions
|
|
78
|
+
if step["done"] and step["icon"] == "fa fa-clock-o"
|
|
79
|
+
]
|
|
80
|
+
)
|
|
81
|
+
self.partner_01.activity_ids.with_user(self.user.id).action_feedback()
|
|
82
|
+
self.assertTrue(record_activity.activity_done_on)
|
|
83
|
+
record_activity.invalidate_recordset()
|
|
84
|
+
self.assertTrue(
|
|
85
|
+
[
|
|
86
|
+
step
|
|
87
|
+
for step in record_activity.step_actions
|
|
88
|
+
if step["done"] and step["icon"] == "fa fa-clock-o"
|
|
89
|
+
]
|
|
90
|
+
)
|
|
91
|
+
|
|
47
92
|
def test_activity_execution_child(self):
|
|
48
93
|
"""
|
|
49
94
|
We will check the execution of the child task (activity_done) is only scheduled
|
|
@@ -101,6 +146,35 @@ class TestAutomationActivity(AutomationTestCase):
|
|
|
101
146
|
self.assertFalse(record_child_activity.scheduled_date)
|
|
102
147
|
self.assertEqual(record_child_activity.state, "rejected")
|
|
103
148
|
|
|
149
|
+
def test_activity_execution_on_cancel_permission(self):
|
|
150
|
+
"""
|
|
151
|
+
We will check the execution of the child task (activity_done) is only scheduled
|
|
152
|
+
after the activity is done
|
|
153
|
+
"""
|
|
154
|
+
activity = self.create_activity_action()
|
|
155
|
+
child_activity = self.create_server_action(
|
|
156
|
+
parent_id=activity.id, trigger_type="activity_done"
|
|
157
|
+
)
|
|
158
|
+
self.configuration.editable_domain = "[('id', '=', %s)]" % self.partner_01.id
|
|
159
|
+
self.configuration.start_automation()
|
|
160
|
+
self.env["automation.configuration"].cron_automation()
|
|
161
|
+
self.env["automation.record.step"]._cron_automation_steps()
|
|
162
|
+
record_activity = self.env["automation.record.step"].search(
|
|
163
|
+
[("configuration_step_id", "=", activity.id)]
|
|
164
|
+
)
|
|
165
|
+
record_child_activity = self.env["automation.record.step"].search(
|
|
166
|
+
[("configuration_step_id", "=", child_activity.id)]
|
|
167
|
+
)
|
|
168
|
+
self.assertEqual(
|
|
169
|
+
record_activity, self.partner_01.activity_ids.automation_record_step_id
|
|
170
|
+
)
|
|
171
|
+
self.assertFalse(record_activity.activity_done_on)
|
|
172
|
+
self.assertFalse(record_child_activity.scheduled_date)
|
|
173
|
+
self.partner_01.activity_ids.with_user(self.user.id).unlink()
|
|
174
|
+
self.assertFalse(record_activity.activity_done_on)
|
|
175
|
+
self.assertFalse(record_child_activity.scheduled_date)
|
|
176
|
+
self.assertEqual(record_child_activity.state, "rejected")
|
|
177
|
+
|
|
104
178
|
def test_activity_execution_cancel_child(self):
|
|
105
179
|
"""
|
|
106
180
|
We will check the execution of the child task (activity_cancel) is only scheduled
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: odoo-addon-automation_oca
|
|
3
|
-
Version: 16.0.1.5.
|
|
3
|
+
Version: 16.0.1.5.3
|
|
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:9989a6bfa92d3f63943ddaa67bbb0ca0b2ebc25419b5ad3231d3841722be0a71
|
|
26
26
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
27
|
|
|
28
28
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
odoo/addons/automation_oca/README.rst,sha256=
|
|
1
|
+
odoo/addons/automation_oca/README.rst,sha256=bYDhKmQy1hOqyYxE-NX5CZjUuV8FbbUziBOrKlgpMAc,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=QO6pD9kwwcD0OTZMHA7q5tBHoTbWcHXr3_eOWkzvKUs,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
|
|
@@ -17,7 +17,7 @@ odoo/addons/automation_oca/models/automation_record.py,sha256=LYZ1fkijB2R3QjBoJN
|
|
|
17
17
|
odoo/addons/automation_oca/models/automation_record_step.py,sha256=dC0L1Rk7w4z-dm6psEU1Vhb-HxUmapIhVPaGGhbphvs,16955
|
|
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
|
-
odoo/addons/automation_oca/models/mail_activity.py,sha256=
|
|
20
|
+
odoo/addons/automation_oca/models/mail_activity.py,sha256=D5l4CeIM_IvZ_a5g3iMC8qiD1u1iUIYRmGvDRRSHv9o,855
|
|
21
21
|
odoo/addons/automation_oca/models/mail_mail.py,sha256=g0hDGkcsdcFl2CLOhPsM5FlzBUsGaYjlCudblHJnZZk,1773
|
|
22
22
|
odoo/addons/automation_oca/models/mail_thread.py,sha256=a1n52bOGi79RGm8G2LT8VTIkMLaliW3jWQfumVUoGFc,2639
|
|
23
23
|
odoo/addons/automation_oca/readme/CONTRIBUTORS.md,sha256=p8_-Mu8Mj7YOCCgizqC5Y02wD8jghcxSizPsYhmQQDs,52
|
|
@@ -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=PEd-3tH0GwFN8fh-kYViR3K52a9Em1DobXrcmp6liC8,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
|
|
@@ -40,7 +40,7 @@ odoo/addons/automation_oca/static/src/views/automation_kanban/automation_kanban_
|
|
|
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
42
|
odoo/addons/automation_oca/tests/test_automation_action.py,sha256=GT7Kja9l1Z-9MzWhKPuDc1a5-IkdHNgABtNVX50Sr24,8994
|
|
43
|
-
odoo/addons/automation_oca/tests/test_automation_activity.py,sha256=
|
|
43
|
+
odoo/addons/automation_oca/tests/test_automation_activity.py,sha256=QfQ6fLBij29JCAXN8mY5ceZIMUpp2WmXbdxlAK5CHSo,13783
|
|
44
44
|
odoo/addons/automation_oca/tests/test_automation_base.py,sha256=SjBtUxD7JRvG0neCWpPi36fcxafV3nR4IKg9jmNvFcw,28453
|
|
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
|
|
@@ -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.5.
|
|
60
|
-
odoo_addon_automation_oca-16.0.1.5.
|
|
61
|
-
odoo_addon_automation_oca-16.0.1.5.
|
|
62
|
-
odoo_addon_automation_oca-16.0.1.5.
|
|
59
|
+
odoo_addon_automation_oca-16.0.1.5.3.dist-info/METADATA,sha256=cP5sRh0no2xH88dM6X6Sp4MGVjN7JDjH0iOL9NKKoqU,7479
|
|
60
|
+
odoo_addon_automation_oca-16.0.1.5.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
61
|
+
odoo_addon_automation_oca-16.0.1.5.3.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
|
62
|
+
odoo_addon_automation_oca-16.0.1.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|