Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14.0 mig sale_commission_formula #301

Merged
merged 31 commits into from
Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0c7ee8c
MV sale commission formula to updated module
Dec 15, 2015
2b691b4
Return removed
adokando Jul 14, 2016
b29c553
[MIG] Porting Sale commission formula to version 10
May 5, 2017
e96dd1d
add method to define formula parameters to be used
Jul 13, 2017
072b083
fix
rgarnau Jul 13, 2017
4486d10
[MIG] sale_commission_formula: Migration to 11.0
etobella Oct 18, 2017
45d9ba9
small fix
rgarnau Jan 23, 2018
b9a81f7
remove obsolete .pot files [ci skip]
sbidoul Jun 15, 2018
22a8a03
[FIX+IMP] sale_commission: Reworked module
pedrobaeza Nov 26, 2018
4fc88a9
[RFR] sale_commission_formula: Adapt module to new structure
pedrobaeza Nov 26, 2018
8e8a849
[IMP] sale_commission: Backport improvements from 12.0
pedrobaeza Dec 14, 2018
81fb21f
[UPD] Update sale_commission_formula.pot
oca-travis Jun 23, 2018
68862ca
[MIG] sale_commission_formula: Migration to 12.0
Feb 20, 2019
c0e5723
Update translation files
OCA-git-bot May 21, 2019
bf576e3
Translated using Weblate (Italian)
eLBati Jul 19, 2019
0d6c91d
[UPD] README.rst
OCA-git-bot Jul 29, 2019
31c92e7
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 18, 2019
0ba89a4
Translated using Weblate (Portuguese)
pedrocs-exo Oct 16, 2019
aba47f5
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 20, 2020
71fd687
Translated using Weblate (Spanish)
pedrobaeza Jun 11, 2020
d631dc6
[IMP] sale_commission_formula: black, isort, prettier
feketemihai Jul 10, 2020
74b8a3e
[MIG] sale_commission_formula: Migration to 13.0
feketemihai Jul 10, 2020
765cf5a
Update translation files
oca-travis Jul 24, 2020
861ef3c
Added translation using Weblate (Spanish (Argentina))
ibuioli Sep 12, 2020
2664475
Translated using Weblate (Spanish (Argentina))
ibuioli Sep 12, 2020
0627b4c
[IMP] sale_commission_formula: Put name to xpath elements + field nam…
pedrobaeza Feb 4, 2021
57424b7
Update translation files
oca-transbot Feb 4, 2021
497ea74
Translated using Weblate (Spanish)
anasuarez1 Mar 17, 2021
7cd7adb
[FIX] sale_commission_formula: test
chienandalu Apr 14, 2021
0d288c3
sale_commission_formula 13.0.1.1.1
OCA-git-bot Apr 14, 2021
9f4c0a8
[MIG] sale_commission_formula: Migration to 14.0
fredzamoabg May 24, 2021
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
86 changes: 86 additions & 0 deletions sale_commission_formula/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
=======================
Sale Commission Formula
=======================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/licence-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/14.0/sale_commission_formula
:alt: OCA/commission
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/commission-14-0/commission-14-0-sale_commission_formula
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/165/14.0
:alt: Try me on Runbot

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

This module extends sale_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 Sales, 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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/commission/issues/new?body=module:%20sale_commission_formula%0Aversion:%2014.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>

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/14.0/sale_commission_formula>`_ 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 sale_commission_formula/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# © 2016 Nicola Malcontenti - Agile Business Group
# © 2016 Davide Corio - Abstract
# License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html

from . import models
17 changes: 17 additions & 0 deletions sale_commission_formula/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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": "Sale Commission Formula",
"version": "14.0.1.0.0",
"category": "Sale",
"license": "AGPL-3",
"summary": "Sale commissions computed by formulas",
"author": "Abstract,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/commission",
"depends": ["sale_commission"],
"data": ["views/sale_commission_view.xml"],
"demo": ["demo/commission_demo.xml"],
"installable": True,
}
42 changes: 42 additions & 0 deletions sale_commission_formula/demo/commission_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="commission_5perc10extra" model="sale.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>
<record id="sale_order_1" model="sale.order">
<field name="partner_id" ref="base.res_partner_2" />
<field name="partner_invoice_id" ref="base.res_partner_2" />
<field name="partner_shipping_id" ref="base.res_partner_2" />
<field name="user_id" ref="base.user_demo" />
<field name="pricelist_id" ref="product.list0" />
<field
name="date_order"
eval="(DateTime.today() - relativedelta(months=1)).strftime('%Y-%m-%d %H:%M')"
/>
</record>
<record id="sale_order_line_1" model="sale.order.line">
<field name="order_id" ref="sale_order_1" />
<field name="name">iPad Retina Display</field>
<field name="product_id" ref="product.product_product_4" />
<field name="product_uom_qty">1</field>
<field name="product_uom" ref="uom.product_uom_unit" />
<field name="price_unit">750.00</field>
</record>
</odoo>
122 changes: 122 additions & 0 deletions sale_commission_formula/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# 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: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_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: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_commission_form
#, fuzzy
msgid "Account Move Line common fields"
msgstr "Camps comuns de la factura"

#. module: sale_commission_formula
#: model:ir.model,name:sale_commission_formula.model_sale_commission
msgid "Commission in sales"
msgstr "Comissió de les vendes"

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

#. module: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_commission_form
msgid "Field"
msgstr "Camp"

#. module: sale_commission_formula
#: model:ir.model.fields,field_description:sale_commission_formula.field_sale_commission__formula
#: model:ir.model.fields.selection,name:sale_commission_formula.selection__sale_commission__commission_type__formula
msgid "Formula"
msgstr "Fórmula"

#. module: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_commission_form
msgid "Instructions"
msgstr "Instruccions"

#. module: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_commission_form
msgid "Label"
msgstr "Etiqueta"

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

#. module: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_commission_form
msgid "Quantity"
msgstr "Quantitat"

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

#. module: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_commission_form
msgid "Subtotal"
msgstr "Subtotal"

#. module: sale_commission_formula
#: model:ir.model.fields,field_description:sale_commission_formula.field_sale_commission__commission_type
msgid "Type"
msgstr ""

#. module: sale_commission_formula
#: model_terms:ir.ui.view,arch_db:sale_commission_formula.sale_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"
Loading