odoo-addon-sale-commission-product-criteria 16.0.1.0.0.2__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.
Files changed (25) hide show
  1. odoo/addons/sale_commission_product_criteria/README.rst +116 -0
  2. odoo/addons/sale_commission_product_criteria/__init__.py +1 -0
  3. odoo/addons/sale_commission_product_criteria/__manifest__.py +22 -0
  4. odoo/addons/sale_commission_product_criteria/demo/sale_agent_demo.xml +69 -0
  5. odoo/addons/sale_commission_product_criteria/i18n/it.po +427 -0
  6. odoo/addons/sale_commission_product_criteria/i18n/sale_commission_product_criteria.pot +396 -0
  7. odoo/addons/sale_commission_product_criteria/models/__init__.py +5 -0
  8. odoo/addons/sale_commission_product_criteria/models/account_move.py +30 -0
  9. odoo/addons/sale_commission_product_criteria/models/commission.py +266 -0
  10. odoo/addons/sale_commission_product_criteria/models/sale.py +55 -0
  11. odoo/addons/sale_commission_product_criteria/models/sale_commission_line_mixin.py +78 -0
  12. odoo/addons/sale_commission_product_criteria/models/settlement.py +7 -0
  13. odoo/addons/sale_commission_product_criteria/readme/CONTRIBUTORS.rst +6 -0
  14. odoo/addons/sale_commission_product_criteria/readme/DESCRIPTION.rst +16 -0
  15. odoo/addons/sale_commission_product_criteria/readme/USAGE.rst +7 -0
  16. odoo/addons/sale_commission_product_criteria/security/ir.model.access.csv +3 -0
  17. odoo/addons/sale_commission_product_criteria/static/description/icon.png +0 -0
  18. odoo/addons/sale_commission_product_criteria/static/description/index.html +451 -0
  19. odoo/addons/sale_commission_product_criteria/tests/__init__.py +1 -0
  20. odoo/addons/sale_commission_product_criteria/tests/test_sale_commission_product_criteria.py +204 -0
  21. odoo/addons/sale_commission_product_criteria/views/views.xml +239 -0
  22. odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/METADATA +135 -0
  23. odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/RECORD +25 -0
  24. odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/WHEEL +5 -0
  25. odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,239 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
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
+ <!-- Modified sale_commission views -->
8
+ <record
9
+ model="ir.ui.view"
10
+ id="view_order_agent_form_inherit_sale_commission_product_criteria_mod"
11
+ >
12
+ <field
13
+ name="name"
14
+ >sale.agent.order.inherit.form.sale_commission_product_criteria.mod</field>
15
+ <field name="model">sale.order</field>
16
+ <field name="priority" eval="99" />
17
+ <field name="inherit_id" ref="sale_commission.view_order_agent_form_inherit" />
18
+ <field name="arch" type="xml">
19
+ <button name="button_edit_agents" position="replace">
20
+ <button
21
+ name="button_edit_agents"
22
+ title="Edit agents"
23
+ icon="fa-users"
24
+ attrs="{'invisible': [('commission_free', '=', True)]}"
25
+ type="object"
26
+ />
27
+ </button>
28
+ </field>
29
+ </record>
30
+
31
+ <record model="ir.ui.view" id="sale_commission_form_lines_mod">
32
+ <field name="name">commission.form.view.inherit</field>
33
+ <field name="model">commission</field>
34
+ <field name="inherit_id" ref="commission.commission_form" />
35
+ <field name="arch" type="xml">
36
+ <xpath expr="//field[@name='section_ids']/.." position="attributes">
37
+ <attribute
38
+ name="attrs"
39
+ >{'invisible': [('commission_type', '=', 'product')]}</attribute>
40
+ </xpath>
41
+ <sheet position="inside">
42
+ <group
43
+ string="Rules"
44
+ name="rules_group"
45
+ attrs="{'invisible': [('commission_type', '!=', 'product')]}"
46
+ >
47
+ <field
48
+ name="item_ids"
49
+ nolabel="1"
50
+ context="{'hide_commission_id':1}"
51
+ colspan="2"
52
+ >
53
+ <tree>
54
+ <field name="sequence" invisible="1" />
55
+ <field name="name" string="Applied On" />
56
+ <field name="commission_value" />
57
+ <field name="based_on" invisible="1" />
58
+ </tree>
59
+ </field>
60
+ </group>
61
+ </sheet>
62
+ </field>
63
+ </record>
64
+
65
+ <record model="ir.ui.view" id="view_sale_order_line_tree_mod">
66
+ <field name="name">sale.order.line.agent.mod</field>
67
+ <field name="model">sale.order.line.agent</field>
68
+ <field name="priority" eval="99" />
69
+ <field name="inherit_id" ref="sale_commission.view_sale_order_line_tree" />
70
+ <field name="arch" type="xml">
71
+ <field name="commission_id" position="attributes">
72
+ <attribute name="invisible">1</attribute>
73
+ </field>
74
+ <field name="amount" position="before">
75
+ <field name="applied_on_name" string="Applied On" invisible="1" />
76
+ <field name="based_on" string="Based On" invisible="1" />
77
+ <field name="commission_type" string="Price Type" invisible="1" />
78
+ <field name="fixed_amount" string="Amount (fixed)" invisible="1" />
79
+ <field name="percent_amount" string="Amount (%)" invisible="1" />
80
+ <field name="discount" string="Applied Disc. (%)" invisible="1" />
81
+ </field>
82
+ <field name="amount" position="replace">
83
+ <field name="applied_commission_id" invisible="1" />
84
+ <field name="amount" string="Final Amount" />
85
+ </field>
86
+ </field>
87
+ </record>
88
+
89
+ <!-- New views -->
90
+ <record id="commission_item_form_view" model="ir.ui.view">
91
+ <field name="name">commission.item.form</field>
92
+ <field name="model">commission.item</field>
93
+ <field name="arch" type="xml">
94
+ <form string="Commission Item">
95
+ <sheet>
96
+ <h1>
97
+ <field name="name" />
98
+ </h1>
99
+ <group>
100
+ <group name="pricelist_rule_target">
101
+ <field name="company_id" invisible="1" />
102
+ <field
103
+ name="commission_id"
104
+ invisible="context.get('hide_commission_id')"
105
+ options="{'no_create': True, 'no_open': 1}"
106
+ />
107
+ <field name="applied_on" widget="radio" />
108
+ <field name="based_on" invisible="1" />
109
+ <field
110
+ name="categ_id"
111
+ attrs="{
112
+ 'invisible':[('applied_on', '!=', '2_product_category')],
113
+ 'required':[('applied_on', '=', '2_product_category')]}"
114
+ options="{'no_create':1}"
115
+ />
116
+ <field
117
+ name="product_tmpl_id"
118
+ attrs="{
119
+ 'invisible':[('applied_on', '!=', '1_product')],
120
+ 'required':[('applied_on', '=', '1_product')]}"
121
+ options="{'no_create':1}"
122
+ />
123
+ <field
124
+ name="product_id"
125
+ attrs="{
126
+ 'invisible':[('applied_on', '!=', '0_product_variant')],
127
+ 'required':[('applied_on', '=', '0_product_variant')]}"
128
+ options="{'no_create':1}"
129
+ />
130
+ </group>
131
+ </group>
132
+ <group
133
+ string="Commission Computation"
134
+ name="commission_computation"
135
+ groups="sales_team.group_sale_manager"
136
+ >
137
+ <group name="commission_rule_method">
138
+ <field
139
+ name="commission_type"
140
+ string="Compute Price"
141
+ widget="radio"
142
+ />
143
+ </group>
144
+ <group name="commission_rule_base">
145
+ <field
146
+ name="fixed_amount"
147
+ attrs="{'invisible':[('commission_type', '!=', 'fixed')]}"
148
+ />
149
+ <label
150
+ for="percent_amount"
151
+ attrs="{'invisible':[('commission_type', '!=', 'percentage')]}"
152
+ />
153
+ <div
154
+ attrs="{'invisible':[('commission_type', '!=', 'percentage')]}"
155
+ >
156
+ <field
157
+ name="percent_amount"
158
+ class="oe_inline"
159
+ attrs="{'invisible':[('commission_type', '!=', 'percentage')]}"
160
+ />
161
+ %%
162
+ </div>
163
+ </group>
164
+ </group>
165
+ </sheet>
166
+ </form>
167
+ </field>
168
+ </record>
169
+
170
+ <record id="commission_item_tree_view" model="ir.ui.view">
171
+ <field name="name">commission.item.tree</field>
172
+ <field name="model">commission.item</field>
173
+ <field name="arch" type="xml">
174
+ <tree>
175
+ <field name="commission_id" />
176
+ <field name="name" />
177
+ <field name="applied_on" optional="hide" />
178
+ <field name="commission_value" />
179
+ <field name="based_on" />
180
+ </tree>
181
+ </field>
182
+ </record>
183
+
184
+ <record id="commission_item_search" model="ir.ui.view">
185
+ <field name="name">commission.item.search.view</field>
186
+ <field name="model">commission.item</field>
187
+ <field name="arch" type="xml">
188
+ <search string="Commission Items">
189
+ <field name="commission_id" />
190
+ <field name="product_tmpl_id" />
191
+ <field name="product_id" />
192
+ <field name="categ_id" />
193
+ <group expand="0" string="Group By">
194
+ <filter
195
+ string="Commission"
196
+ name="group_by_commission"
197
+ domain="[]"
198
+ context="{'group_by' : 'commission_id'}"
199
+ />
200
+ </group>
201
+ </search>
202
+ </field>
203
+ </record>
204
+
205
+ <record id="commission_item_action" model="ir.actions.act_window">
206
+ <field name="name">Commission Items</field>
207
+ <field name="type">ir.actions.act_window</field>
208
+ <field name="res_model">commission.item</field>
209
+ <field name="view_mode">tree,form</field>
210
+ <field name="context">
211
+ {"hide_commission_id":1, 'search_default_group_by_commission': 1,}
212
+ </field>
213
+ </record>
214
+
215
+ <record id="commission_item_action_tree" model="ir.actions.act_window">
216
+ <field name="name">Commission Items</field>
217
+ <field name="type">ir.actions.act_window</field>
218
+ <field name="res_model">commission.item</field>
219
+ <field name="view_mode">tree,form</field>
220
+ <field name="context">
221
+ {"hide_commission_id":0, 'search_default_group_by_commission': 1,}
222
+ </field>
223
+ <field
224
+ name="view_ids"
225
+ eval="[(5, 0, 0),
226
+ (0, 0, {'view_mode': 'tree', 'view_id': ref('commission_item_tree_view')}),
227
+ (0, 0, {'view_mode': 'form', 'view_id': ref('commission_item_form_view')})]"
228
+ />
229
+ </record>
230
+
231
+ <menuitem
232
+ name="Commission Type Items"
233
+ id="menu_sale_commissions_items"
234
+ action="commission_item_action_tree"
235
+ parent="commission.menu_commission_management"
236
+ groups="sales_team.group_sale_manager"
237
+ sequence="10"
238
+ />
239
+ </odoo>
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.1
2
+ Name: odoo-addon-sale-commission-product-criteria
3
+ Version: 16.0.1.0.0.2
4
+ Summary: Advanced commissions rules
5
+ Home-page: https://github.com/OCA/commission
6
+ Author: Ilyas, Ooops404, Odoo Community Association (OCA)
7
+ Author-email: support@odoo-community.org
8
+ License: AGPL-3
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Framework :: Odoo
12
+ Classifier: Framework :: Odoo :: 16.0
13
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
14
+ Requires-Python: >=3.10
15
+ Requires-Dist: odoo-addon-sale-commission <16.1dev,>=16.0dev
16
+ Requires-Dist: odoo <16.1dev,>=16.0a
17
+
18
+ ================================
19
+ Sale Commission Product Criteria
20
+ ================================
21
+
22
+ ..
23
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24
+ !! This file is generated by oca-gen-addon-readme !!
25
+ !! changes will be overwritten. !!
26
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
+ !! source digest: sha256:679118d6039b7893a5538b753c6809a13130884e390fb913b1a83cb29c0a0dd4
28
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
29
+
30
+ .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
31
+ :target: https://odoo-community.org/page/development-status
32
+ :alt: Beta
33
+ .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
34
+ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
35
+ :alt: License: AGPL-3
36
+ .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github
37
+ :target: https://github.com/OCA/commission/tree/16.0/sale_commission_product_criteria
38
+ :alt: OCA/commission
39
+ .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
40
+ :target: https://translation.odoo-community.org/projects/commission-16-0/commission-16-0-sale_commission_product_criteria
41
+ :alt: Translate me on Weblate
42
+ .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
43
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/commission&target_branch=16.0
44
+ :alt: Try me on Runboat
45
+
46
+ |badge1| |badge2| |badge3| |badge4| |badge5|
47
+
48
+ This module allows to set in the same Commission Type different commission rates according to the product on SO/invoice line.
49
+
50
+ This is made possible since this module adds a new "Product criteria" type to Commission Type and applies commission rates with the same logic of sale pricelist items.
51
+
52
+ For example, such a Commission Type can grant:
53
+
54
+ 10% on a specific Product A,
55
+ 10$ on Product B,
56
+ 4% on products in Category 1 and
57
+ 5$ on all other products.
58
+
59
+ In SO/invoice, system will apply different commissions based on variant/product/category or global, applied hierarchically. This means that for the example above, if product A is assigned to Category 1, commission assigned is 10%, as per variant/product/category/global rule application order.
60
+
61
+ Furthermore, these commission type items can be accessed and created by a specific menu, to facilitate their management in environments with lots of records.
62
+
63
+ The form for commission type item can be extended by future modules with further conditions to decide when to apply a specific item.
64
+
65
+ **Table of contents**
66
+
67
+ .. contents::
68
+ :local:
69
+
70
+ Usage
71
+ =====
72
+
73
+ To use features of this module, you need to:
74
+
75
+ #. Go to Commissions > Configuration > Commission Types.
76
+ #. Create a Commission Type with type = "Product criteria".
77
+ #. Create multiple rules based on variant/product/category or global
78
+ #. These rules will be sorted according to the same logic of sale pricelist.
79
+ #. Rest flow is according to OCA sale_commission module.
80
+
81
+ Bug Tracker
82
+ ===========
83
+
84
+ Bugs are tracked on `GitHub Issues <https://github.com/OCA/commission/issues>`_.
85
+ In case of trouble, please check there if your issue has already been reported.
86
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
87
+ `feedback <https://github.com/OCA/commission/issues/new?body=module:%20sale_commission_product_criteria%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
88
+
89
+ Do not contact contributors directly about support or help with technical issues.
90
+
91
+ Credits
92
+ =======
93
+
94
+ Authors
95
+ ~~~~~~~
96
+
97
+ * Ilyas
98
+ * Ooops404
99
+
100
+ Contributors
101
+ ~~~~~~~~~~~~
102
+
103
+ * `Ooops404 <https://www.ooops404.com>`__:
104
+
105
+ * Ilyas <irazor147@gmail.com>
106
+ * `Aion Tech <https://aiontech.company/>`_:
107
+
108
+ * Simone Rubino <simone.rubino@aion-tech.it>
109
+
110
+ Maintainers
111
+ ~~~~~~~~~~~
112
+
113
+ This module is maintained by the OCA.
114
+
115
+ .. image:: https://odoo-community.org/logo.png
116
+ :alt: Odoo Community Association
117
+ :target: https://odoo-community.org
118
+
119
+ OCA, or the Odoo Community Association, is a nonprofit organization whose
120
+ mission is to support the collaborative development of Odoo features and
121
+ promote its widespread use.
122
+
123
+ .. |maintainer-ilyasProgrammer| image:: https://github.com/ilyasProgrammer.png?size=40px
124
+ :target: https://github.com/ilyasProgrammer
125
+ :alt: ilyasProgrammer
126
+
127
+ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
128
+
129
+ |maintainer-ilyasProgrammer|
130
+
131
+ This module is part of the `OCA/commission <https://github.com/OCA/commission/tree/16.0/sale_commission_product_criteria>`_ project on GitHub.
132
+
133
+ You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
134
+
135
+
@@ -0,0 +1,25 @@
1
+ odoo/addons/sale_commission_product_criteria/README.rst,sha256=GZcbaiiegez3acF7tgnoaycuLPCkx7WrUpknlyUvjoY,4673
2
+ odoo/addons/sale_commission_product_criteria/__init__.py,sha256=X9EJGOE2GtZbS0G82PtSXmWSZ_R8jEM0rlJTDliQjp4,21
3
+ odoo/addons/sale_commission_product_criteria/__manifest__.py,sha256=NH8q7txMpXTAWfSe0X59g-jxhv8aq6EWT_ahB-VJVm8,718
4
+ odoo/addons/sale_commission_product_criteria/demo/sale_agent_demo.xml,sha256=8Mij5a1TTFyyIZK0LEoenWh-W4ucTNtwqDAF87EbT34,2665
5
+ odoo/addons/sale_commission_product_criteria/i18n/it.po,sha256=e5Md5uoZoIR_GhY5RkNxTtsIkhylxYM7vcZmOZRBUps,19641
6
+ odoo/addons/sale_commission_product_criteria/i18n/sale_commission_product_criteria.pot,sha256=G2IoUjZvuMhQsc_UGFK2gXMnUueGhvekJpz_e-W9r8A,15871
7
+ odoo/addons/sale_commission_product_criteria/models/__init__.py,sha256=lkOi79dgLqCz-aoOq2zO8Ivf3vThIh453bGJBkUre-E,137
8
+ odoo/addons/sale_commission_product_criteria/models/account_move.py,sha256=Q1cYIDJCmro0SrVUjP2JeQeeTxkOmN6U_99t6D3B-a4,1027
9
+ odoo/addons/sale_commission_product_criteria/models/commission.py,sha256=RDVhOtaEdrXelaI5tcFKczgNXmPor90wBKG2cur3H6U,9723
10
+ odoo/addons/sale_commission_product_criteria/models/sale.py,sha256=cMxxuZWVmldPoUqKDgU-_BFMC8X292x9l1b6badrhEA,1991
11
+ odoo/addons/sale_commission_product_criteria/models/sale_commission_line_mixin.py,sha256=pbGdRGuKk9l4JE8isznZSkhDtHoGzNyp6C_NTX7dQwM,3065
12
+ odoo/addons/sale_commission_product_criteria/models/settlement.py,sha256=c9rhprm8Vz4HHYJ2-5tgs2Gi1UzNmjtAlmEWVw7BuN8,191
13
+ odoo/addons/sale_commission_product_criteria/readme/CONTRIBUTORS.rst,sha256=QY6T07gmiPvozyM8CAFJN6IQBD0SFtwghoDU5fLIIjA,168
14
+ odoo/addons/sale_commission_product_criteria/readme/DESCRIPTION.rst,sha256=7ZEUYQ-wLmMBfizeqrWf09YeCiA7TSdcb-nocTRsUrk,1038
15
+ odoo/addons/sale_commission_product_criteria/readme/USAGE.rst,sha256=opr0MY68l3yNs3rj31HxdAVcFT2wAUpDIntiu5mXuMo,366
16
+ odoo/addons/sale_commission_product_criteria/security/ir.model.access.csv,sha256=l4p29Bw20_pdCUkFc0ApE6mAEohTQOPo5VwmuyYMnZY,324
17
+ odoo/addons/sale_commission_product_criteria/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
18
+ odoo/addons/sale_commission_product_criteria/static/description/index.html,sha256=WqpO6eeA7VOnpRaKR4IQrcYVLBzTlz3AaRbcTXceNgU,14420
19
+ odoo/addons/sale_commission_product_criteria/tests/__init__.py,sha256=gR27hVtH8fvlbCsPJq4JRfSYMXQlBQkjhULr_rcLki0,52
20
+ odoo/addons/sale_commission_product_criteria/tests/test_sale_commission_product_criteria.py,sha256=R7S0lOOiLPlpFrBQJWPjhBgSG5h46Z5tz4Cw7kfKvU8,8377
21
+ odoo/addons/sale_commission_product_criteria/views/views.xml,sha256=Q2wwfQxtZ3cUMXkAoyrBGpmGDqSFi295pWnSoYBL0bs,10449
22
+ odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/METADATA,sha256=iPGBYaU62xnw5a0Z3_zB7zcSmk8RYn1Hz-KKMwvoHow,5293
23
+ odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
24
+ odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
25
+ odoo_addon_sale_commission_product_criteria-16.0.1.0.0.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.42.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+