odoo-addon-automation-oca 16.0.1.4.0.3__py3-none-any.whl → 16.0.1.4.1__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.
@@ -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:6b8f1cf697f8dd49bee14bd4b103cdb239ee9beaa400398c8840337d31c107a6
10
+ !! source digest: sha256:b3656b6058157c201bf22bda8a54fc7e84ebd6109f3d3f3f88f5e0fb53759b49
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -5,7 +5,7 @@
5
5
  "name": "Automation Oca",
6
6
  "summary": """
7
7
  Automate actions in threaded models""",
8
- "version": "16.0.1.4.0",
8
+ "version": "16.0.1.4.1",
9
9
  "license": "AGPL-3",
10
10
  "category": "Automation",
11
11
  "author": "Dixmit,Odoo Community Association (OCA)",
@@ -107,29 +107,26 @@ class AutomationRecord(models.Model):
107
107
  for sub_ids in self._cr.split_for_in_conditions(ids):
108
108
  self._cr.execute(
109
109
  """
110
- SELECT id, res_id, model, configuration_id
110
+ SELECT id, res_id, model
111
111
  FROM "%s"
112
112
  WHERE id = ANY (%%(ids)s)"""
113
113
  % self._table,
114
114
  dict(ids=list(sub_ids)),
115
115
  )
116
- for eid, res_id, model, config_id in self._cr.fetchall():
117
- model_data[model][(res_id, config_id)].add(eid)
118
-
116
+ for eid, res_id, model in self._cr.fetchall():
117
+ model_data[model][res_id].add(eid)
119
118
  for model, targets in model_data.items():
120
119
  if not self.env[model].check_access_rights("read", False):
121
120
  continue
122
- res_ids = [res_id for res_id, _ in targets]
121
+ res_ids = targets.keys()
123
122
  recs = self.env[model].browse(res_ids)
124
123
  missing = recs - recs.exists()
125
124
  if len(missing) > 0:
126
- for (res_id, config_id) in [
127
- (res_id, config_id)
128
- for (res_id, config_id) in targets.keys()
129
- if res_id is None or res_id in missing.ids
130
- ]:
125
+ for res_id in targets.keys():
126
+ if res_id and res_id not in missing.ids:
127
+ continue
131
128
  automation_record = self.env["automation.record"].browse(
132
- list(targets[(res_id, config_id)])
129
+ list(targets[res_id])
133
130
  )
134
131
  if not automation_record.is_orphan_record:
135
132
  _logger.info(
@@ -144,14 +141,14 @@ class AutomationRecord(models.Model):
144
141
  "res_id": False,
145
142
  }
146
143
  )
147
- result += list(targets[(res_id, config_id)])
144
+ result += list(targets[res_id])
148
145
  allowed = (
149
146
  self.env[model]
150
147
  .with_context(active_test=False)
151
148
  ._search([("id", "in", recs.ids)])
152
149
  )
153
150
  for target_id in allowed:
154
- result += list(targets.get((target_id, config_id), []))
151
+ result += list(targets.get(target_id, {}))
155
152
  if len(orig_ids) == limit and len(result) < len(orig_ids):
156
153
  result.extend(
157
154
  self._search(
@@ -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:6b8f1cf697f8dd49bee14bd4b103cdb239ee9beaa400398c8840337d31c107a6
370
+ !! source digest: sha256:b3656b6058157c201bf22bda8a54fc7e84ebd6109f3d3f3f88f5e0fb53759b49
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&amp;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>
@@ -545,6 +545,26 @@ class TestAutomationBase(AutomationTestCase):
545
545
  set(activity.trigger_child_types.keys()),
546
546
  )
547
547
 
548
+ def test_search(self):
549
+ configuration_2 = self.env["automation.configuration"].create(
550
+ {
551
+ "name": "Test configuration",
552
+ "model_id": self.env.ref("base.model_res_partner").id,
553
+ "is_periodic": True,
554
+ }
555
+ )
556
+ self.create_server_action()
557
+ self.create_server_action(configuration_id=configuration_2.id)
558
+ self.configuration.editable_domain = "[('id', '=', %s)]" % self.partner_01.id
559
+ self.configuration.start_automation()
560
+ configuration_2.editable_domain = "[('id', '=', %s)]" % self.partner_01.id
561
+ configuration_2.start_automation()
562
+ self.env["automation.configuration"].cron_automation()
563
+ record_activity = self.env["automation.record"].search(
564
+ [("model", "=", self.partner_01._name), ("res_id", "=", self.partner_01.id)]
565
+ )
566
+ self.assertEqual(2, len(record_activity))
567
+
548
568
  def test_generation_orphan_record(self):
549
569
  self.configuration.editable_domain = (
550
570
  "['|', ('id', '=', %s), ('id', '=', %s)]"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-automation_oca
3
- Version: 16.0.1.4.0.3
3
+ Version: 16.0.1.4.1
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:6b8f1cf697f8dd49bee14bd4b103cdb239ee9beaa400398c8840337d31c107a6
25
+ !! source digest: sha256:b3656b6058157c201bf22bda8a54fc7e84ebd6109f3d3f3f88f5e0fb53759b49
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=FV4-Gql3x1lfbJxRvRSmy9ib_F27bZ8abf0a2j2iuH0,6962
1
+ odoo/addons/automation_oca/README.rst,sha256=JBz9HnHRHnRat_rm1iQBznQr0J4cwiLsJCuCPiWYbEs,6962
2
2
  odoo/addons/automation_oca/__init__.py,sha256=dnUeA_K1torbiMNF3tt2dtECdk-FkWm01DByr9MBMIA,69
3
- odoo/addons/automation_oca/__manifest__.py,sha256=hN4UCzPOt7LnYMne4uQ9ARKdXY2MDnik2Os1LIUmDvU,1181
3
+ odoo/addons/automation_oca/__manifest__.py,sha256=yvVWcV4OZr1dALohQL27V1VMgyBlsT0GMFGJZJrDwQU,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
@@ -13,7 +13,7 @@ odoo/addons/automation_oca/models/__init__.py,sha256=gRWvgicyFDELSeVnpRow1mGuWjf
13
13
  odoo/addons/automation_oca/models/automation_configuration.py,sha256=VaWXg_6EnUnTdLDV_eZnWKXXVU27nGmZR_lnGIeKstA,12086
14
14
  odoo/addons/automation_oca/models/automation_configuration_step.py,sha256=dU3d-FTrcopgO9rSnTOv4KAmgePx_GKHVH1P6PijELI,20349
15
15
  odoo/addons/automation_oca/models/automation_filter.py,sha256=W8VM977yXH_hZUKCO8ZDKsvzIjYegoIGMN1QLEvikOY,706
16
- odoo/addons/automation_oca/models/automation_record.py,sha256=Q6aO1pbHHqXeWkugzURHc_U2jp9fP2_RGqPmH_Dbl_k,7362
16
+ odoo/addons/automation_oca/models/automation_record.py,sha256=LYZ1fkijB2R3QjBoJN_gnsPzqjkp-Gk_6LyPywMQAQA,7172
17
17
  odoo/addons/automation_oca/models/automation_record_step.py,sha256=A7_bM2BOidjlPCY8xHGOlH0ThqD8xhpqr4aZhPM0bFE,16024
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
@@ -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=hEeH9ARMQfJCGZRCADP6GcbCzQB5ZgacWbhunU7tD68,18215
32
+ odoo/addons/automation_oca/static/description/index.html,sha256=83kfnvZc8eSS9iZETCfk2GULrJmCwoig90EC9-Svvdo,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
@@ -41,7 +41,7 @@ odoo/addons/automation_oca/tests/__init__.py,sha256=5VS2h2Hl3gUzMQqKgPUYnq-_Wkk7
41
41
  odoo/addons/automation_oca/tests/common.py,sha256=Zu5AcWGMgoDKdsQ4VMyhHTnot1f7Hunh4tDH9CSHbXw,3558
42
42
  odoo/addons/automation_oca/tests/test_automation_action.py,sha256=LLw57To88U6Ercinc0bH49_FRueqKfYHI_FKsw1aA8s,8370
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=ThzNwQqlIrWvFHBe8jwXqlXebNPLkONtkSt-8Wt9iOA,24440
44
+ odoo/addons/automation_oca/tests/test_automation_base.py,sha256=SubYQxJEYGcHwqRhA8CUODd-FooGaxQ0ontms-uWPCA,25372
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
@@ -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.4.0.3.dist-info/METADATA,sha256=dBZWdCqsr-YXyhw3ngSe0I9gb6ZGfO5D6O4rAVgs6Yo,7481
60
- odoo_addon_automation_oca-16.0.1.4.0.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
61
- odoo_addon_automation_oca-16.0.1.4.0.3.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
62
- odoo_addon_automation_oca-16.0.1.4.0.3.dist-info/RECORD,,
59
+ odoo_addon_automation_oca-16.0.1.4.1.dist-info/METADATA,sha256=LL-vKYKPrD86UpD1Y95Zco2S6UmOVBdhbRlHPxVNlYo,7479
60
+ odoo_addon_automation_oca-16.0.1.4.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
61
+ odoo_addon_automation_oca-16.0.1.4.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
62
+ odoo_addon_automation_oca-16.0.1.4.1.dist-info/RECORD,,