odoo-addon-sale-commission-product-criteria-domain 16.0.1.0.2__py3-none-any.whl → 16.0.1.0.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/sale_commission_product_criteria_domain/README.rst +6 -2
- odoo/addons/sale_commission_product_criteria_domain/__manifest__.py +1 -1
- odoo/addons/sale_commission_product_criteria_domain/models/sale_commission_line_mixin.py +56 -53
- odoo/addons/sale_commission_product_criteria_domain/static/description/index.html +17 -11
- {odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.2.dist-info → odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info}/METADATA +9 -5
- {odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.2.dist-info → odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info}/RECORD +8 -8
- {odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.2.dist-info → odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info}/WHEEL +1 -1
- {odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.2.dist-info → odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,7 @@
|
|
1
|
+
.. image:: https://odoo-community.org/readme-banner-image
|
2
|
+
:target: https://odoo-community.org/get-involved?utm_source=readme
|
3
|
+
:alt: Odoo Community Association
|
4
|
+
|
1
5
|
=======================================
|
2
6
|
Sale Commission Product Criteria Domain
|
3
7
|
=======================================
|
@@ -7,13 +11,13 @@ Sale Commission Product Criteria Domain
|
|
7
11
|
!! This file is generated by oca-gen-addon-readme !!
|
8
12
|
!! changes will be overwritten. !!
|
9
13
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
10
|
-
!! source digest: sha256:
|
14
|
+
!! source digest: sha256:b543f76e2e9567d9e3b545debdd7a56bb90e3e07bded4ac0ba24189993a2bd70
|
11
15
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
12
16
|
|
13
17
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
14
18
|
:target: https://odoo-community.org/page/development-status
|
15
19
|
:alt: Beta
|
16
|
-
.. |badge2| image:: https://img.shields.io/badge/
|
20
|
+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
17
21
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
18
22
|
:alt: License: AGPL-3
|
19
23
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
|
4
4
|
{
|
5
5
|
"name": "Sale Commission Product Criteria Domain",
|
6
|
-
"version": "16.0.1.0.
|
6
|
+
"version": "16.0.1.0.3",
|
7
7
|
"author": "Ilyas," "Ooops404," "Odoo Community Association (OCA)",
|
8
8
|
"contributors": ["Ilyas"],
|
9
9
|
"maintainers": ["ilyasProgrammer"],
|
@@ -8,59 +8,62 @@ class SaleCommissionLineMixin(models.AbstractModel):
|
|
8
8
|
_inherit = "commission.line.mixin"
|
9
9
|
|
10
10
|
def _get_commission_items(self, commission, product):
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
while categ:
|
15
|
-
categ_ids[categ.id] = True
|
16
|
-
categ = categ.parent_id
|
17
|
-
categ_ids = list(categ_ids)
|
18
|
-
|
19
|
-
# Module specific mod:
|
20
|
-
if self.object_id._name == "sale.order.line":
|
21
|
-
partner = self.object_id.order_id.partner_id
|
22
|
-
elif self.object_id._name == "account.move.line":
|
23
|
-
partner = self.object_id.partner_id
|
11
|
+
res = []
|
12
|
+
if commission.commission_type != "product_restricted":
|
13
|
+
res = super()._get_commission_items(commission, product)
|
24
14
|
else:
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
15
|
+
categ_ids = {}
|
16
|
+
categ = product.categ_id
|
17
|
+
while categ:
|
18
|
+
categ_ids[categ.id] = True
|
19
|
+
categ = categ.parent_id
|
20
|
+
categ_ids = list(categ_ids)
|
21
|
+
|
22
|
+
# Module specific mod:
|
23
|
+
if self.object_id._name == "sale.order.line":
|
24
|
+
partner = self.object_id.order_id.partner_id
|
25
|
+
elif self.object_id._name == "account.move.line":
|
26
|
+
partner = self.object_id.partner_id
|
27
|
+
else:
|
28
|
+
partner = False
|
29
|
+
if partner:
|
30
|
+
group_ids = (
|
31
|
+
partner.commission_item_agent_ids.filtered(
|
32
|
+
lambda x: x.agent_id == self.agent_id
|
33
|
+
)
|
34
|
+
.mapped("group_ids")
|
35
|
+
.ids
|
30
36
|
)
|
31
|
-
|
32
|
-
|
33
|
-
)
|
34
|
-
else:
|
35
|
-
group_ids = []
|
37
|
+
else:
|
38
|
+
group_ids = []
|
36
39
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
return
|
40
|
+
# Select all suitable items. Order by best match
|
41
|
+
# (priority is: all/cat/subcat/product/variant).
|
42
|
+
self.env.cr.execute(
|
43
|
+
"""
|
44
|
+
SELECT
|
45
|
+
item.id
|
46
|
+
FROM
|
47
|
+
commission_item AS item
|
48
|
+
LEFT JOIN product_category AS categ ON item.categ_id = categ.id
|
49
|
+
LEFT JOIN commission_item_agent AS cia ON item.group_id = cia.id
|
50
|
+
WHERE
|
51
|
+
(item.product_tmpl_id IS NULL OR item.product_tmpl_id = any(%s))
|
52
|
+
AND (item.product_id IS NULL OR item.product_id = any(%s))
|
53
|
+
AND (item.categ_id IS NULL OR item.categ_id = any(%s))
|
54
|
+
AND (item.commission_id = %s)
|
55
|
+
AND (item.active = TRUE)
|
56
|
+
AND (cia.id IS NULL OR cia.id = any(%s))
|
57
|
+
ORDER BY
|
58
|
+
item.applied_on, item.based_on, categ.complete_name desc
|
59
|
+
""",
|
60
|
+
(
|
61
|
+
product.product_tmpl_id.ids,
|
62
|
+
product.ids,
|
63
|
+
categ_ids,
|
64
|
+
commission._origin.id,
|
65
|
+
group_ids,
|
66
|
+
),
|
67
|
+
)
|
68
|
+
res = [x[0] for x in self.env.cr.fetchall()]
|
69
|
+
return res
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
5
|
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
6
|
-
<title>
|
6
|
+
<title>README.rst</title>
|
7
7
|
<style type="text/css">
|
8
8
|
|
9
9
|
/*
|
@@ -360,16 +360,21 @@ ul.auto-toc {
|
|
360
360
|
</style>
|
361
361
|
</head>
|
362
362
|
<body>
|
363
|
-
<div class="document"
|
364
|
-
<h1 class="title">Sale Commission Product Criteria Domain</h1>
|
363
|
+
<div class="document">
|
365
364
|
|
365
|
+
|
366
|
+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
|
367
|
+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
|
368
|
+
</a>
|
369
|
+
<div class="section" id="sale-commission-product-criteria-domain">
|
370
|
+
<h1>Sale Commission Product Criteria Domain</h1>
|
366
371
|
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
367
372
|
!! This file is generated by oca-gen-addon-readme !!
|
368
373
|
!! changes will be overwritten. !!
|
369
374
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
370
|
-
!! source digest: sha256:
|
375
|
+
!! source digest: sha256:b543f76e2e9567d9e3b545debdd7a56bb90e3e07bded4ac0ba24189993a2bd70
|
371
376
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
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/
|
377
|
+
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/commission/tree/16.0/sale_commission_product_criteria_domain"><img alt="OCA/commission" src="https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/commission-16-0/commission-16-0-sale_commission_product_criteria_domain"><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/commission&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
373
378
|
<p>This module allows to limit applied commission items for specific groups.</p>
|
374
379
|
<p>This module allows to manage the following commission structure use case:</p>
|
375
380
|
<blockquote>
|
@@ -391,7 +396,7 @@ ul.auto-toc {
|
|
391
396
|
</ul>
|
392
397
|
</div>
|
393
398
|
<div class="section" id="usage">
|
394
|
-
<
|
399
|
+
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
|
395
400
|
<p>Go to Commissions > Configuration > Commission Type Items Groups</p>
|
396
401
|
<p>Create one or more new Groups, eg. “Italy” and “Spain”</p>
|
397
402
|
<p>Create new Commission type, select type “Product Criteria (with restrictions)”, eg: “Southern Europe”</p>
|
@@ -407,7 +412,7 @@ ul.auto-toc {
|
|
407
412
|
<p>On sales for customer X, only Commission type lines with group “Spain” will be applied to agent; on sales for customer Y, only Commission type lines with group “Italy” will be applied to agent.</p>
|
408
413
|
</div>
|
409
414
|
<div class="section" id="bug-tracker">
|
410
|
-
<
|
415
|
+
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
|
411
416
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/commission/issues">GitHub Issues</a>.
|
412
417
|
In case of trouble, please check there if your issue has already been reported.
|
413
418
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
@@ -415,16 +420,16 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|
415
420
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
416
421
|
</div>
|
417
422
|
<div class="section" id="credits">
|
418
|
-
<
|
423
|
+
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
|
419
424
|
<div class="section" id="authors">
|
420
|
-
<
|
425
|
+
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
|
421
426
|
<ul class="simple">
|
422
427
|
<li>Ilyas</li>
|
423
428
|
<li>Ooops404</li>
|
424
429
|
</ul>
|
425
430
|
</div>
|
426
431
|
<div class="section" id="contributors">
|
427
|
-
<
|
432
|
+
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
|
428
433
|
<ul class="simple">
|
429
434
|
<li><a class="reference external" href="https://www.ooops404.com">Ooops404</a>:<ul>
|
430
435
|
<li>Ilyas <<a class="reference external" href="mailto:irazor147@gmail.com">irazor147@gmail.com</a>></li>
|
@@ -437,7 +442,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|
437
442
|
</ul>
|
438
443
|
</div>
|
439
444
|
<div class="section" id="maintainers">
|
440
|
-
<
|
445
|
+
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
|
441
446
|
<p>This module is maintained by the OCA.</p>
|
442
447
|
<a class="reference external image-reference" href="https://odoo-community.org">
|
443
448
|
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
@@ -452,5 +457,6 @@ promote its widespread use.</p>
|
|
452
457
|
</div>
|
453
458
|
</div>
|
454
459
|
</div>
|
460
|
+
</div>
|
455
461
|
</body>
|
456
462
|
</html>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: odoo-addon-sale_commission_product_criteria_domain
|
3
|
-
Version: 16.0.1.0.
|
3
|
+
Version: 16.0.1.0.3
|
4
4
|
Summary: Sale Commission Product Criteria Domain
|
5
5
|
Home-page: https://github.com/OCA/commission
|
6
6
|
Author: Ilyas,Ooops404,Odoo Community Association (OCA)
|
@@ -11,8 +11,12 @@ Classifier: Framework :: Odoo
|
|
11
11
|
Classifier: Framework :: Odoo :: 16.0
|
12
12
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
13
13
|
Requires-Python: >=3.10
|
14
|
-
Requires-Dist: odoo-addon-sale-commission-product-criteria
|
15
|
-
Requires-Dist: odoo
|
14
|
+
Requires-Dist: odoo-addon-sale-commission-product-criteria<16.1dev,>=16.0dev
|
15
|
+
Requires-Dist: odoo<16.1dev,>=16.0a
|
16
|
+
|
17
|
+
.. image:: https://odoo-community.org/readme-banner-image
|
18
|
+
:target: https://odoo-community.org/get-involved?utm_source=readme
|
19
|
+
:alt: Odoo Community Association
|
16
20
|
|
17
21
|
=======================================
|
18
22
|
Sale Commission Product Criteria Domain
|
@@ -23,13 +27,13 @@ Sale Commission Product Criteria Domain
|
|
23
27
|
!! This file is generated by oca-gen-addon-readme !!
|
24
28
|
!! changes will be overwritten. !!
|
25
29
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
26
|
-
!! source digest: sha256:
|
30
|
+
!! source digest: sha256:b543f76e2e9567d9e3b545debdd7a56bb90e3e07bded4ac0ba24189993a2bd70
|
27
31
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
28
32
|
|
29
33
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
30
34
|
:target: https://odoo-community.org/page/development-status
|
31
35
|
:alt: Beta
|
32
|
-
.. |badge2| image:: https://img.shields.io/badge/
|
36
|
+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
|
33
37
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
34
38
|
:alt: License: AGPL-3
|
35
39
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github
|
@@ -1,6 +1,6 @@
|
|
1
|
-
odoo/addons/sale_commission_product_criteria_domain/README.rst,sha256=
|
1
|
+
odoo/addons/sale_commission_product_criteria_domain/README.rst,sha256=AwDPchZ3CtNXfP8FV56gfQJETRXSGhepl5DMpeqK_dU,4980
|
2
2
|
odoo/addons/sale_commission_product_criteria_domain/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
|
3
|
-
odoo/addons/sale_commission_product_criteria_domain/__manifest__.py,sha256=
|
3
|
+
odoo/addons/sale_commission_product_criteria_domain/__manifest__.py,sha256=hJm55vIffuJsjz9T8nus4P8gxvvI-Mt4ucYGDbOfdEY,763
|
4
4
|
odoo/addons/sale_commission_product_criteria_domain/demo/demo_data.xml,sha256=Y7mgP_NPlkUzZKV6BIdlxtEQH1aq7vt2OJ7MGMWtp-Q,5541
|
5
5
|
odoo/addons/sale_commission_product_criteria_domain/i18n/it.po,sha256=WNPmZTOBV7QRXv575PAxh2-JdY4xpBkq9gIwlFceB6w,14614
|
6
6
|
odoo/addons/sale_commission_product_criteria_domain/i18n/sale_commission_product_criteria_domain.pot,sha256=lg-INIxe1wuWZIlQZP1Zae_fpZfhujRV9-aIU2x2EEo,11488
|
@@ -9,18 +9,18 @@ odoo/addons/sale_commission_product_criteria_domain/models/account_invoice_line_
|
|
9
9
|
odoo/addons/sale_commission_product_criteria_domain/models/commission.py,sha256=g9mdRGnTrqq32Lym3e5F3shvstTDjrRdelHhV4d0e9c,3125
|
10
10
|
odoo/addons/sale_commission_product_criteria_domain/models/commission_group.py,sha256=zV3N_6RaI4I3BFp4rt2Nhl2vJSLMLoaVIFAm6a43G-E,2387
|
11
11
|
odoo/addons/sale_commission_product_criteria_domain/models/partner.py,sha256=_xMZYcqAZb0H2zylniaHE8smkkLDXSh9o3ZrcFZNDwc,3267
|
12
|
-
odoo/addons/sale_commission_product_criteria_domain/models/sale_commission_line_mixin.py,sha256=
|
12
|
+
odoo/addons/sale_commission_product_criteria_domain/models/sale_commission_line_mixin.py,sha256=OvD-MtaO3fMhVno7LgHrTGmX-IzciGSDvLnmUUcF76M,2648
|
13
13
|
odoo/addons/sale_commission_product_criteria_domain/models/sale_order_line_agent.py,sha256=YJQfTxz6vewckhj6Scv4mIq8wbEpdF9jTIxJgMoJKjY,995
|
14
14
|
odoo/addons/sale_commission_product_criteria_domain/readme/CONTRIBUTORS.rst,sha256=QY6T07gmiPvozyM8CAFJN6IQBD0SFtwghoDU5fLIIjA,168
|
15
15
|
odoo/addons/sale_commission_product_criteria_domain/readme/DESCRIPTION.rst,sha256=qsRXR_UvuOjbDPqTPItEm1gYwvJ0DvDbBCSG7R-zAXk,411
|
16
16
|
odoo/addons/sale_commission_product_criteria_domain/readme/USAGE.rst,sha256=CnL3oaHfNgAOItbFzGR25ZLDv3KVG-qdqQq7QHnHTD4,1086
|
17
17
|
odoo/addons/sale_commission_product_criteria_domain/security/ir.model.access.csv,sha256=-vtY9FSb3jQBI1HkDNVD0ej2Oy4AMkwCMnExdDkEXII,385
|
18
18
|
odoo/addons/sale_commission_product_criteria_domain/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
|
19
|
-
odoo/addons/sale_commission_product_criteria_domain/static/description/index.html,sha256=
|
19
|
+
odoo/addons/sale_commission_product_criteria_domain/static/description/index.html,sha256=ycoDcQeF1r1U4Yx1SUhqVtTCcDrDR_-bPZMz98VajcE,14871
|
20
20
|
odoo/addons/sale_commission_product_criteria_domain/tests/__init__.py,sha256=K_GPhvCh3bp_MHaPKdXSc0Wn5qBDFBUiMXKD5pQbc0E,59
|
21
21
|
odoo/addons/sale_commission_product_criteria_domain/tests/test_sale_commission_product_criteria_domain.py,sha256=hnsSbveqMGByUjs3i4IoGxHARWF4lYq5zODvdqSY7Gw,14967
|
22
22
|
odoo/addons/sale_commission_product_criteria_domain/views/views.xml,sha256=tidsdWjUfVy2pgMmmUFUzD1NrQFoKHC3B60uO0GHYw8,9168
|
23
|
-
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.
|
24
|
-
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.
|
25
|
-
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.
|
26
|
-
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.
|
23
|
+
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info/METADATA,sha256=mjZojhkn4IdRwaWJpM6yadd7rsLHfVPLV0Qbo89AGAI,5611
|
24
|
+
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
25
|
+
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
26
|
+
odoo_addon_sale_commission_product_criteria_domain-16.0.1.0.3.dist-info/RECORD,,
|