Skip to content

Commit fdddea4

Browse files
committed
Merge PR #668 into 18.0
Signed-off-by pedrobaeza
2 parents 68dee7d + 29243e0 commit fdddea4

25 files changed

Lines changed: 3617 additions & 0 deletions
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
================================
2+
Sale Commission Product Criteria
3+
================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:4bd16205ce53357916f35f63494314b7c39a51d4b787e42f7e13b0eb69fc90f0
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github
20+
:target: https://github.com/OCA/commission/tree/18.0/sale_commission_oca_product_criteria
21+
:alt: OCA/commission
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/commission-18-0/commission-18-0-sale_commission_oca_product_criteria
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/commission&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows to set in the same Commission Type different
32+
commission rates according to the product on SO/invoice line.
33+
34+
This is made possible since this module adds a new "Product criteria"
35+
type to Commission Type and applies commission rates with the same logic
36+
of sale pricelist items.
37+
38+
For example, such a Commission Type can grant:
39+
40+
10% on a specific Product A, 10$ on Product B, 4% on products in
41+
Category 1 and 5$ on all other products.
42+
43+
In SO/invoice, system will apply different commissions based on
44+
variant/product/category or global, applied hierarchically. This means
45+
that for the example above, if product A is assigned to Category 1,
46+
commission assigned is 10%, as per variant/product/category/global rule
47+
application order.
48+
49+
Furthermore, these commission type items can be accessed and created by
50+
a specific menu, to facilitate their management in environments with
51+
lots of records.
52+
53+
The form for commission type item can be extended by future modules with
54+
further conditions to decide when to apply a specific item.
55+
56+
**Table of contents**
57+
58+
.. contents::
59+
:local:
60+
61+
Usage
62+
=====
63+
64+
To use features of this module, you need to:
65+
66+
1. Go to Commissions > Configuration > Commission Types.
67+
2. Create a Commission Type with type = "Product criteria".
68+
3. Create multiple rules based on variant/product/category or global
69+
4. These rules will be sorted according to the same logic of sale
70+
pricelist.
71+
5. Rest flow is according to OCA sale_commission module.
72+
73+
Bug Tracker
74+
===========
75+
76+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/commission/issues>`_.
77+
In case of trouble, please check there if your issue has already been reported.
78+
If you spotted it first, help us to smash it by providing a detailed and welcomed
79+
`feedback <https://github.com/OCA/commission/issues/new?body=module:%20sale_commission_oca_product_criteria%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
80+
81+
Do not contact contributors directly about support or help with technical issues.
82+
83+
Credits
84+
=======
85+
86+
Authors
87+
-------
88+
89+
* Ilyas
90+
* Ooops404
91+
92+
Contributors
93+
------------
94+
95+
- `Ooops404 <https://www.ooops404.com>`__:
96+
97+
- Ilyas <irazor147@gmail.com>
98+
99+
- `Aion Tech <https://aiontech.company/>`__:
100+
101+
- Simone Rubino <simone.rubino@aion-tech.it>
102+
103+
- `Tecnativa <https://www.tecnativa.com>`__
104+
105+
- Carlos Roca
106+
- David Bañón Gil
107+
108+
Maintainers
109+
-----------
110+
111+
This module is maintained by the OCA.
112+
113+
.. image:: https://odoo-community.org/logo.png
114+
:alt: Odoo Community Association
115+
:target: https://odoo-community.org
116+
117+
OCA, or the Odoo Community Association, is a nonprofit organization whose
118+
mission is to support the collaborative development of Odoo features and
119+
promote its widespread use.
120+
121+
.. |maintainer-ilyasProgrammer| image:: https://github.com/ilyasProgrammer.png?size=40px
122+
:target: https://github.com/ilyasProgrammer
123+
:alt: ilyasProgrammer
124+
.. |maintainer-aleuffre| image:: https://github.com/aleuffre.png?size=40px
125+
:target: https://github.com/aleuffre
126+
:alt: aleuffre
127+
.. |maintainer-renda-dev| image:: https://github.com/renda-dev.png?size=40px
128+
:target: https://github.com/renda-dev
129+
:alt: renda-dev
130+
.. |maintainer-PicchiSeba| image:: https://github.com/PicchiSeba.png?size=40px
131+
:target: https://github.com/PicchiSeba
132+
:alt: PicchiSeba
133+
134+
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
135+
136+
|maintainer-ilyasProgrammer| |maintainer-aleuffre| |maintainer-renda-dev| |maintainer-PicchiSeba|
137+
138+
This module is part of the `OCA/commission <https://github.com/OCA/commission/tree/18.0/sale_commission_oca_product_criteria>`_ project on GitHub.
139+
140+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# © 2023 ooops404
2+
# Copyright 2023 Simone Rubino - Aion Tech
3+
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
4+
{
5+
"name": "Sale Commission Product Criteria",
6+
"summary": "Advanced commissions rules",
7+
"version": "18.0.1.0.0",
8+
"author": "Ilyas, Ooops404, Odoo Community Association (OCA)",
9+
"maintainers": ["ilyasProgrammer", "aleuffre", "renda-dev", "PicchiSeba"],
10+
"website": "https://github.com/OCA/commission",
11+
"category": "Sales Management",
12+
"license": "AGPL-3",
13+
"depends": ["sale_commission_oca"],
14+
"data": [
15+
"reports/report_settlement_template.xml",
16+
"views/views.xml",
17+
"security/ir.model.access.csv",
18+
],
19+
"demo": ["demo/sale_agent_demo.xml"],
20+
"application": False,
21+
"installable": True,
22+
"auto_install": False,
23+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
~ Copyright 2023 Simone Rubino - Aion Tech
4+
~ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
5+
-->
6+
<odoo>
7+
<record id="demo_commission_rules" model="commission">
8+
<field name="name">Based on Rules</field>
9+
<field name="commission_type">product</field>
10+
</record>
11+
12+
<record id="demo_commission_rules_item_1" model="commission.item">
13+
<field name="commission_id" ref="demo_commission_rules" />
14+
<field name="sequence" eval="1" />
15+
<field name="based_on">sol</field>
16+
<field name="applied_on">3_global</field>
17+
<field name="commission_type">fixed</field>
18+
<field name="fixed_amount">10</field>
19+
</record>
20+
21+
<record id="demo_commission_rules_item_2" model="commission.item">
22+
<field name="commission_id" ref="demo_commission_rules" />
23+
<field name="sequence" eval="2" />
24+
<field name="based_on">sol</field>
25+
<field name="applied_on">2_product_category</field>
26+
<field name="commission_type">fixed</field>
27+
<field name="fixed_amount">20</field>
28+
<field name="categ_id" ref="product.product_category_5" />
29+
</record>
30+
31+
<record id="demo_commission_rules_item_3" model="commission.item">
32+
<field name="commission_id" ref="demo_commission_rules" />
33+
<field name="sequence" eval="3" />
34+
<field name="based_on">sol</field>
35+
<field name="applied_on">1_product</field>
36+
<field name="commission_type">percentage</field>
37+
<field name="percent_amount">5</field>
38+
<field
39+
name="product_tmpl_id"
40+
ref="product.product_product_4_product_template"
41+
/>
42+
</record>
43+
44+
<record id="demo_commission_rules_item_4" model="commission.item">
45+
<field name="commission_id" ref="demo_commission_rules" />
46+
<field name="sequence" eval="4" />
47+
<field name="based_on">sol</field>
48+
<field name="applied_on">0_product_variant</field>
49+
<field name="commission_type">percentage</field>
50+
<field name="percent_amount">15</field>
51+
<field name="product_id" ref="product.product_product_4" />
52+
</record>
53+
54+
<record id="demo_agent_rules" model="res.partner">
55+
<field name="name">Agent Rules</field>
56+
<field name="is_company">True</field>
57+
<field name="agent">True</field>
58+
<field name="commission_id" ref="demo_commission_rules" />
59+
</record>
60+
61+
<record id="base.res_partner_12" model="res.partner">
62+
<field
63+
name="agent_ids"
64+
eval="[Command.set([ref('sale_commission_oca_product_criteria.demo_agent_rules')])]"
65+
/>
66+
</record>
67+
</odoo>

0 commit comments

Comments
 (0)