Skip to content

Commit

Permalink
[16.0][MIG] commission_formula
Browse files Browse the repository at this point in the history
  • Loading branch information
andrel-exo committed Aug 30, 2023
1 parent e09580d commit 2742265
Show file tree
Hide file tree
Showing 35 changed files with 6,011 additions and 0 deletions.
58 changes: 58 additions & 0 deletions commission_formula/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
==================
Commission Formula
==================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge_devstat| image:: https://img.shields.io/badge/maturity-beta-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Beta

.. |badge_license| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:alt: AGPL-3

|badge_devstat| |badge_license|

This module extends commission to introduce the use of formulas to
compute the agent commissions.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

* Go to Commission > Configuration > Commission Types, and create a commission with type formula

Credits
=======

Authors
~~~~~~~

* Abstract

Contributors
~~~~~~~~~~~~

* Davide Corio <davide.corio@abstract.it>
* Nicola Malcontenti <nicola.malcontenti@agilebg.com>
* Duc, Dao Dong <duc.dd@komit-consulting.com> (https://komit-consulting.com)
* `NextERP Romania <https://www.nexterp.ro>`_:

* Fekete Mihai <feketemihai@nexterp.ro>

Maintainers
~~~~~~~~~~~

This module is maintained by Exo Software.

Contact the maintainer through their official support channels in case you find
any issues with this module.
5 changes: 5 additions & 0 deletions commission_formula/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2016 Nicola Malcontenti - Agile Business Group
# Copyright 2016 Davide Corio - Abstract
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html

from . import models
22 changes: 22 additions & 0 deletions commission_formula/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2016 Nicola Malcontenti - Agile Business Group
# Copyright 2016 Davide Corio - Abstract
# Copyright 2021 Tecnativa - Pedro M. Baeza
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
{
"name": "Commission Formula",
"version": "16.0.1.0.0",
"category": "Commission",
"license": "AGPL-3",
"summary": "Commissions computed by formulas",
"author": "Abstract,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/commission",
"depends": ["commission", "account"],
"data": ["views/commission_view.xml"],
"demo": ["demo/commission_demo.xml"],
"assets": {
"web.assets_backend": [
"commission_formula/static/src/css/commission_formula.css",
],
},
"installable": True,
}
26 changes: 26 additions & 0 deletions commission_formula/demo/commission_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>

<record id="commission_5perc10extra" model="commission">
<field name="name">5% + 10% extra</field>
<field name="commission_type">formula</field>
<field name="active">True</field>
<field name="formula">if line._name == 'sale.order.line':
partial = (line.price_subtotal / 100)*5
result = partial + (partial / 100)*10
if line._name == 'account.move.line':
partial = (line.price_subtotal / 100)*5
result = partial + (partial / 100)*10
</field>
</record>

<record id="agent1" model="res.partner">
<field name="name">Agent 1</field>
<field name="is_company">True</field>
<field name="agent">True</field>
<field name="supplier_rank">1</field>
<field name="customer_rank">0</field>
<field name="commission_id" ref="commission_5perc10extra" />
</record>

</odoo>
123 changes: 123 additions & 0 deletions commission_formula/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_commission_formula
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-14 15:14+0000\n"
"PO-Revision-Date: 2017-12-14 15:14+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid ""
"<span class=\"instructions\">\n"
" Use 'line' to access all the line fields.\n"
" As field names may vary, you should differentiate the\n"
" formulas for sale.order.line and account.move.line.\n"
" You can, for instance, use line._name == 'sale.order.line'\n"
" or line._name == 'account.move.line'.\n"
"\n"
" Use 'result' to return the commission amount.\n"
" </span>"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
#, fuzzy
msgid "Account Move Line common fields"
msgstr "Camps comuns de la factura"

#. module: commission_formula
#: model:ir.model,name:commission_formula.model_commission
#, fuzzy
msgid "Commission"
msgstr "Comissió de les vendes"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Discount (%)"
msgstr "Descompte (%)"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Field"
msgstr "Camp"

#. module: commission_formula
#: model:ir.model.fields,field_description:commission_formula.field_commission__formula
#: model:ir.model.fields.selection,name:commission_formula.selection__commission__commission_type__formula
msgid "Formula"
msgstr "Fórmula"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Instructions"
msgstr "Instruccions"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Label"
msgstr "Etiqueta"

#. module: commission_formula
#: model:ir.model,name:commission_formula.model_commission_line_mixin
msgid ""
"Mixin model for having commission agent lines in any object inheriting from "
"this one"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Quantity"
msgstr "Quantitat"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Sale Oder Line common fields"
msgstr "Camps comuns de la línia de comanda de venda"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Subtotal"
msgstr "Subtotal"

#. module: commission_formula
#: model:ir.model.fields,field_description:commission_formula.field_commission__commission_type
msgid "Type"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Unit Price"
msgstr "Preu unitari"

#~ msgid "discount"
#~ msgstr "Descompte"

#~ msgid "price_subtotal"
#~ msgstr "price_subtotal"

#~ msgid "price_unit"
#~ msgstr "price_unit"

#~ msgid "product_uom_qty"
#~ msgstr "product_uom_qty"

#~ msgid "quantity"
#~ msgstr "quantitat"

#, fuzzy
#~| msgid "Instructions"
#~ msgid "By sections"
#~ msgstr "Instruccions"
96 changes: 96 additions & 0 deletions commission_formula/i18n/commission_formula.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * commission_formula
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid ""
"<span class=\"instructions\">\n"
" Use 'line' to access all the line fields.\n"
" As field names may vary, you should differentiate the\n"
" formulas for sale.order.line and account.move.line.\n"
" You can, for instance, use line._name == 'sale.order.line'\n"
" or line._name == 'account.move.line'.\n"
"\n"
" Use 'result' to return the commission amount.\n"
" </span>"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Account Move Line common fields"
msgstr ""

#. module: commission_formula
#: model:ir.model,name:commission_formula.model_commission
msgid "Commission"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Discount (%)"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Field"
msgstr ""

#. module: commission_formula
#: model:ir.model.fields,field_description:commission_formula.field_commission__formula
#: model:ir.model.fields.selection,name:commission_formula.selection__commission__commission_type__formula
msgid "Formula"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Instructions"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Label"
msgstr ""

#. module: commission_formula
#: model:ir.model,name:commission_formula.model_commission_line_mixin
msgid ""
"Mixin model for having commission agent lines in any object inheriting from "
"this one"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Quantity"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Sale Oder Line common fields"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Subtotal"
msgstr ""

#. module: commission_formula
#: model:ir.model.fields,field_description:commission_formula.field_commission__commission_type
msgid "Type"
msgstr ""

#. module: commission_formula
#: model_terms:ir.ui.view,arch_db:commission_formula.commission_form
msgid "Unit Price"
msgstr ""
Loading

0 comments on commit 2742265

Please sign in to comment.