Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions commission_formula_oca/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Commission Formula OCA
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a9e63a8cf3e0058bb5db7b36d09cc4ff0b59f7b332eba9b9253689fa2b0b06d0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github
:target: https://github.com/OCA/commission/tree/19.0/commission_formula_oca
:alt: OCA/commission
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/commission-19-0/commission-19-0-commission_formula_oca
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/commission&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/commission/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/commission/issues/new?body=module:%20commission_formula_oca%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

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>

- `Sygel <https://www.sygel.es>`__:

- Alberto Martínez <alberto.martinez@sygel.es>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/commission <https://github.com/OCA/commission/tree/19.0/commission_formula_oca>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions commission_formula_oca/__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_oca/__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 OCA",
"version": "19.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": ["account_commission_oca"],
"data": ["views/commission_view.xml"],
"demo": ["demo/commission_demo.xml"],
"assets": {
"web.assets_backend": [
"commission_formula_oca/static/src/css/commission_formula_oca.css",
],
},
"installable": True,
}
24 changes: 24 additions & 0 deletions commission_formula_oca/demo/commission_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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>
106 changes: 106 additions & 0 deletions commission_formula_oca/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * commission_formula_oca
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"

#. module: commission_formula_oca
#: model_terms:ir.ui.view,arch_db:commission_formula_oca.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_oca
#: model_terms:ir.ui.view,arch_db:commission_formula_oca.commission_form
msgid "Account Move Line common fields"
msgstr ""

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

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

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

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

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

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

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

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

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

#. module: commission_formula_oca
#: model:ir.model.fields,help:commission_formula_oca.field_commission__commission_type
msgid ""
"Select the percentage type of the commission:\n"
"* 'Fixed percentage': all commissions are computed with a fixed percentage. You can fill the percentage in the field \"Fixed percentage\".\n"
"* 'By sections': percentage varies depending amount intervals. You can fill intervals and percentages in the section \"Rate definition\"."
msgstr ""

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

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

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