Skip to content

Commit f44cefc

Browse files
committed
Merge PR #637 into 18.0
Signed-off-by pedrobaeza
2 parents 93c654e + fef0266 commit f44cefc

34 files changed

+6276
-0
lines changed

commission_formula_oca/README.rst

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
======================
2+
Commission Formula OCA
3+
======================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:e70d837650c3e901505cadd6358a30eebcc605e2a5583c55da2d2fcd770c63f8
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/commission_formula_oca
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-commission_formula_oca
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 extends commission to introduce the use of formulas to
32+
compute the agent commissions.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Usage
40+
=====
41+
42+
To use this module, you need to:
43+
44+
- Go to Commission > Configuration > Commission Types, and create a
45+
commission with type formula
46+
47+
Bug Tracker
48+
===========
49+
50+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/commission/issues>`_.
51+
In case of trouble, please check there if your issue has already been reported.
52+
If you spotted it first, help us to smash it by providing a detailed and welcomed
53+
`feedback <https://github.com/OCA/commission/issues/new?body=module:%20commission_formula_oca%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
54+
55+
Do not contact contributors directly about support or help with technical issues.
56+
57+
Credits
58+
=======
59+
60+
Authors
61+
-------
62+
63+
* Abstract
64+
65+
Contributors
66+
------------
67+
68+
- Davide Corio <[email protected]>
69+
- Nicola Malcontenti <[email protected]>
70+
- Duc, Dao Dong <[email protected]>
71+
(https://komit-consulting.com)
72+
- `NextERP Romania <https://www.nexterp.ro>`__:
73+
74+
- Fekete Mihai <[email protected]>
75+
76+
- `Sygel <https://www.sygel.es>`__:
77+
78+
- Alberto Martínez <[email protected]>
79+
80+
Maintainers
81+
-----------
82+
83+
This module is maintained by the OCA.
84+
85+
.. image:: https://odoo-community.org/logo.png
86+
:alt: Odoo Community Association
87+
:target: https://odoo-community.org
88+
89+
OCA, or the Odoo Community Association, is a nonprofit organization whose
90+
mission is to support the collaborative development of Odoo features and
91+
promote its widespread use.
92+
93+
This module is part of the `OCA/commission <https://github.com/OCA/commission/tree/18.0/commission_formula_oca>`_ project on GitHub.
94+
95+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

commission_formula_oca/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2016 Nicola Malcontenti - Agile Business Group
2+
# Copyright 2016 Davide Corio - Abstract
3+
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
4+
5+
from . import models
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2016 Nicola Malcontenti - Agile Business Group
2+
# Copyright 2016 Davide Corio - Abstract
3+
# Copyright 2021 Tecnativa - Pedro M. Baeza
4+
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
5+
{
6+
"name": "Commission Formula OCA",
7+
"version": "18.0.1.0.0",
8+
"category": "Commission",
9+
"license": "AGPL-3",
10+
"summary": "Commissions computed by formulas",
11+
"author": "Abstract,Odoo Community Association (OCA)",
12+
"website": "https://github.com/OCA/commission",
13+
"depends": ["commission_oca", "account"],
14+
"data": ["views/commission_view.xml"],
15+
"demo": ["demo/commission_demo.xml"],
16+
"assets": {
17+
"web.assets_backend": [
18+
"commission_formula_oca/static/src/css/commission_formula_oca.css",
19+
],
20+
},
21+
"installable": True,
22+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo>
3+
<record id="commission_5perc10extra" model="commission">
4+
<field name="name">5% + 10% extra</field>
5+
<field name="commission_type">formula</field>
6+
<field name="active">True</field>
7+
<field name="formula">if line._name == 'sale.order.line':
8+
partial = (line.price_subtotal / 100)*5
9+
result = partial + (partial / 100)*10
10+
if line._name == 'account.move.line':
11+
partial = (line.price_subtotal / 100)*5
12+
result = partial + (partial / 100)*10
13+
</field>
14+
</record>
15+
16+
<record id="agent1" model="res.partner">
17+
<field name="name">Agent 1</field>
18+
<field name="is_company">True</field>
19+
<field name="agent">True</field>
20+
<field name="supplier_rank">1</field>
21+
<field name="customer_rank">0</field>
22+
<field name="commission_id" ref="commission_5perc10extra" />
23+
</record>
24+
</odoo>

commission_formula_oca/i18n/ca.po

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sale_commission_formula
4+
#
5+
# Translators:
6+
# OCA Transbot <[email protected]>, 2017
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: Odoo Server 11.0\n"
10+
"Report-Msgid-Bugs-To: \n"
11+
"POT-Creation-Date: 2017-12-14 15:14+0000\n"
12+
"PO-Revision-Date: 2024-02-13 20:34+0000\n"
13+
"Last-Translator: \"Dept. Técnico\" <[email protected]>\n"
14+
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
15+
"Language: ca\n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=UTF-8\n"
18+
"Content-Transfer-Encoding: \n"
19+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
20+
"X-Generator: Weblate 4.17\n"
21+
22+
#. module: commission_formula
23+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
24+
msgid ""
25+
"<span class=\"instructions\">\n"
26+
" Use 'line' to access all the line fields.\n"
27+
" As field names may vary, you should differentiate the\n"
28+
" formulas for sale.order.line and account.move.line.\n"
29+
" You can, for instance, use line._name == 'sale.order.line'\n"
30+
" or line._name == 'account.move.line'.\n"
31+
"\n"
32+
" Use 'result' to return the commission amount.\n"
33+
" </span>"
34+
msgstr ""
35+
"<span class=\"instructions\">\n"
36+
" Utilitzi 'line' per accedir a tots els camps de la línia.\n"
37+
" Com que els noms dels camps poden variar, hauria d'identificar\n"
38+
" les formules per sale.order.line i per account.invoice.line.\n"
39+
" Pot, per exemple, utilitza line._name == 'sale.order.line'\n"
40+
" o line._name == 'account.invoice.line'.\n"
41+
"\n"
42+
" Utilitzi 'result'per obtenir l'import de la comissió.\n"
43+
" </span>"
44+
45+
#. module: commission_formula
46+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
47+
msgid "Account Move Line common fields"
48+
msgstr "Camps comuns de las línies de factura"
49+
50+
#. module: commission_formula
51+
#: model:ir.model,name:commission_formula.model_commission
52+
msgid "Commission"
53+
msgstr "Comissió"
54+
55+
#. module: commission_formula
56+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
57+
msgid "Discount (%)"
58+
msgstr "Descompte (%)"
59+
60+
#. module: commission_formula
61+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
62+
msgid "Field"
63+
msgstr "Camp"
64+
65+
#. module: commission_formula
66+
#: model:ir.model.fields,field_description:commission_formula.field_commission__formula
67+
#: model:ir.model.fields.selection,name:commission_formula.selection__commission__commission_type__formula
68+
msgid "Formula"
69+
msgstr "Fórmula"
70+
71+
#. module: commission_formula
72+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
73+
msgid "Instructions"
74+
msgstr "Instruccions"
75+
76+
#. module: commission_formula
77+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
78+
msgid "Label"
79+
msgstr "Etiqueta"
80+
81+
#. module: commission_formula
82+
#: model:ir.model,name:commission_formula.model_commission_line_mixin
83+
msgid ""
84+
"Mixin model for having commission agent lines in any object inheriting from "
85+
"this one"
86+
msgstr ""
87+
"Model mixin per tenir línies d'agent de comissions en qualsevol objecta "
88+
"heretant de aquest"
89+
90+
#. module: commission_formula
91+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
92+
msgid "Quantity"
93+
msgstr "Quantitat"
94+
95+
#. module: commission_formula
96+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
97+
msgid "Sale Oder Line common fields"
98+
msgstr "Camps comuns de la línia de comanda de venda"
99+
100+
#. module: commission_formula
101+
#: model:ir.model.fields,help:commission_formula.field_commission__commission_type
102+
msgid ""
103+
"Select the percentage type of the commission:\n"
104+
"* 'Fixed percentage': all commissions are computed with a fixed percentage. "
105+
"You can fill the percentage in the field \"Fixed percentage\".\n"
106+
"* 'By sections': percentage varies depending amount intervals. You can fill "
107+
"intervals and percentages in the section \"Rate definition\"."
108+
msgstr ""
109+
"Selecciona el temps de ponenteja de la comissió:\n"
110+
"* \"Ponenteja fixa\":totes les comissions es compten com un ponenteja fix. "
111+
"Pot omplir el ponenteja en el camp \"Ponenteja fixa\".\n"
112+
"* 'Per trams': el percentatge varia en funció dels intervals d'import. Pot "
113+
"omplir els intervals i percentatge en l'apartat \"Definició de la tarifa\"."
114+
115+
#. module: commission_formula
116+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
117+
msgid "Subtotal"
118+
msgstr "Subtotal"
119+
120+
#. module: commission_formula
121+
#: model:ir.model.fields,field_description:commission_formula.field_commission__commission_type
122+
msgid "Type"
123+
msgstr "Tipus"
124+
125+
#. module: commission_formula
126+
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
127+
msgid "Unit Price"
128+
msgstr "Preu unitari"
129+
130+
#~ msgid "discount"
131+
#~ msgstr "Descompte"
132+
133+
#~ msgid "price_subtotal"
134+
#~ msgstr "price_subtotal"
135+
136+
#~ msgid "price_unit"
137+
#~ msgstr "price_unit"
138+
139+
#~ msgid "product_uom_qty"
140+
#~ msgstr "product_uom_qty"
141+
142+
#~ msgid "quantity"
143+
#~ msgstr "quantitat"
144+
145+
#, fuzzy
146+
#~| msgid "Instructions"
147+
#~ msgid "By sections"
148+
#~ msgstr "Instruccions"

0 commit comments

Comments
 (0)