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

[18.0] [MIG] commission: Migration to 18.0 #577

Open
wants to merge 85 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
41d48f3
[MIG] sale_commission: Migration to 15.0
AungKoKoLin1997 Sep 19, 2022
77520ac
[REF] *commission*: Abstract even more the base module
pedrobaeza Nov 19, 2022
6491a8a
[IMP] commission*: Add settlement_type to commissions
pedrobaeza Dec 1, 2022
6e39539
[UPD] Update commission.pot
Dec 5, 2022
0ce64dd
[UPD] README.rst
OCA-git-bot Dec 5, 2022
3aec091
commission 15.0.2.0.0
OCA-git-bot Dec 5, 2022
d671a9d
Added translation using Weblate (Japanese)
Ryoko04 Dec 6, 2022
36e0899
Translated using Weblate (Japanese)
Ryoko04 Dec 6, 2022
c054d5d
Translated using Weblate (Japanese)
Ryoko04 Dec 9, 2022
04430a4
Translated using Weblate (Japanese)
Ryoko04 Dec 16, 2022
8cc3cca
[MIG] commission: Migration to 16.0
hildickethan Dec 26, 2022
8a1c3c2
[IMP] commission: Align dates in settlement view
hildickethan Dec 28, 2022
f272ce2
[UPD] Update commission.pot
Dec 28, 2022
309dacf
[UPD] README.rst
OCA-git-bot Dec 28, 2022
5834025
Update translation files
weblate Dec 28, 2022
9043541
[UPD] Update commission.pot
Dec 30, 2022
35cead1
Update translation files
weblate Dec 30, 2022
24951f5
[UPD] Update commission.pot
Jan 3, 2023
1a2c77a
Update translation files
weblate Jan 3, 2023
723cac0
[FIX] commission: Show full settlements table in partner
hildickethan Jan 10, 2023
17e7601
commission 16.0.1.1.0
OCA-git-bot Mar 3, 2023
220da1e
[IMP] commission: Default commission_free instead of related
hildickethan Apr 26, 2023
beb9b36
commission 16.0.1.1.1
OCA-git-bot May 2, 2023
acb8ad2
[IMP] commission: use mail thread and improve report
jguenat Jun 10, 2023
5dee02f
[UPD] Update commission.pot
Aug 18, 2023
fa24ca1
commission 16.0.1.2.0
OCA-git-bot Aug 18, 2023
fbc8228
Update translation files
weblate Aug 18, 2023
49498cf
[UPD] README.rst
OCA-git-bot Sep 3, 2023
409297a
[UPD] Update commission.pot
Sep 3, 2023
f940f23
Update translation files
weblate Sep 3, 2023
b6e5789
Added translation using Weblate (Spanish)
Ivorra78 Sep 4, 2023
26028fa
Translated using Weblate (Spanish)
Ivorra78 Sep 4, 2023
f175425
Added translation using Weblate (Italian)
dcorio Sep 15, 2023
583bb33
Translated using Weblate (Italian)
dcorio Oct 5, 2023
6382d7c
Translated using Weblate (Italian)
francesco-ooops Oct 9, 2023
de3b354
Update translation files
weblate Oct 10, 2023
1658ea7
Translated using Weblate (Italian)
mymage Oct 12, 2023
f17d4cf
Translated using Weblate (Italian)
mymage Oct 12, 2023
871ce01
Translated using Weblate (Italian)
francesco-ooops Oct 13, 2023
fe95e03
Translated using Weblate (Italian)
mymage Oct 20, 2023
3a4d08d
Translated using Weblate (Italian)
dcorio Oct 24, 2023
f93cf9a
[UPD] Update commission.pot
Oct 27, 2023
80371f6
Update translation files
weblate Oct 28, 2023
4253c90
Added translation using Weblate (Portuguese (Brazil))
adrianojprado Oct 29, 2023
879a3a9
Translated using Weblate (Portuguese (Brazil))
adrianojprado Oct 29, 2023
d85e072
Added translation using Weblate (Portuguese)
pedrocs-exo Nov 13, 2023
ea28e8b
Translated using Weblate (Portuguese)
pedrocs-exo Nov 13, 2023
cbfe889
Translated using Weblate (Portuguese)
pedrocs-exo Nov 13, 2023
b9cddac
[IMP] account_commission: multi-currency support
alexeirivera87 Mar 14, 2023
1c43033
[FIXUP] improvements based on review
jguenat Aug 22, 2023
44839ab
[BOT] post-merge updates
OCA-git-bot Nov 24, 2023
88113b0
Translated using Weblate (Italian)
mymage Nov 30, 2023
ccfbb81
Translated using Weblate (Italian)
francesco-ooops Dec 14, 2023
e30363c
[IMP] commission: Clarify selection fields
renda-dev Dec 18, 2023
8605c1c
[UPD] Update commission.pot
Dec 18, 2023
b7957f9
[BOT] post-merge updates
OCA-git-bot Dec 18, 2023
e81474f
Update translation files
weblate Dec 18, 2023
c2d21c4
Translated using Weblate (Spanish)
Ivorra78 Dec 18, 2023
993c45e
Translated using Weblate (Italian)
mymage Dec 27, 2023
5cff0b8
Translated using Weblate (Portuguese (Brazil))
adrianojprado Dec 28, 2023
fd0efe8
[MIG] commission: Migration to 17.0
ambientWave Jan 19, 2024
244163e
[IMP] commission: pre-commit auto fixes
ambientWave Apr 19, 2024
d300723
[UPD] Update commission.pot
Apr 19, 2024
40fae47
[BOT] post-merge updates
OCA-git-bot Apr 19, 2024
2dd880f
Update translation files
weblate Apr 19, 2024
2735165
Translated using Weblate (Italian)
mymage Apr 22, 2024
f402c9a
[UPD] Update commission.pot
May 8, 2024
2773e5f
Update translation files
weblate May 8, 2024
356a543
Translated using Weblate (Spanish)
luis-ron May 8, 2024
d56a6f9
[FIX] commission: partner view agent
Tisho99 May 14, 2024
1cd86b8
[BOT] post-merge updates
OCA-git-bot May 14, 2024
dc62d86
[UPD] Update commission.pot
May 16, 2024
009e873
Update translation files
weblate May 16, 2024
7239958
[UPD] Update commission.pot
May 17, 2024
de2a078
Update translation files
weblate May 17, 2024
d08bf0b
Translated using Weblate (Portuguese)
pedrocs-exo Jun 10, 2024
d2b56eb
Translated using Weblate (Portuguese)
pedrocs-exo Jun 10, 2024
acbde42
Translated using Weblate (Portuguese)
pedrocs-exo Jun 10, 2024
920fc78
Translated using Weblate (Portuguese (Brazil))
SottomaiorMacedoTec Jul 6, 2024
987c430
[UPD] Update commission.pot
Jul 10, 2024
228b210
Update translation files
weblate Jul 10, 2024
5fe983a
Added translation using Weblate (Turkish)
metingulsoy Aug 26, 2024
d0002ba
Translated using Weblate (Turkish)
metingulsoy Aug 26, 2024
787a96b
[IMP] commission: pre-commit auto fixes
mb-andema Nov 13, 2024
ab2f47c
[MIG] commission: Migration to 18.0
mb-andema Nov 13, 2024
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
194 changes: 194 additions & 0 deletions commission/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
===========
Commissions
===========

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

.. |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/18.0/commission
:alt: OCA/commission
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/commission-18-0/commission-18-0-commission
: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=18.0
:alt: Try me on Runboat

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

This module provides the base functions for commission operations to
enable the following:

- Define agents with their commissions
- Assign agents to partners
- Create settlements to summarize commissions for certain periods

You can define which base amount is going to be taken into account: net
amount (based on margin) or gross amount (line subtotal amount).

**Table of contents**

.. contents::
:local:

Configuration
=============

For adding commissions:

1. Go to *Commissions > Configuration > Commission types*.
2. Edit or create a new record.
3. Select a name for distinguishing that type.
4. Select the percentage type of the commission:

- **Fixed percentage**: all commissions are computed with a fixed
percentage. You can fill the percentage in the field "Fixed
percentage".
- **By sections**: percentage varies depending amount intervals. You
can fill intervals and percentages in the section "Rate
definition".

5. Select the base amount for computing the percentage:

- **Sale/Invoice Amount**: percentage is computed from the amount put
on sales order/invoice.
- **Margin (Amount - Cost)**: percentage is computed from the profit
only, taken the cost from the product.

For adding new agents:

1. Go to *Commissions > Agents*. You can also access from *Contacts >
Contacts* or *Sales > Orders > Customers*.

2. Edit or create a new record.

3. On "Sales & Purchases" page, mark "Agent" check. It should be checked
if you have accessed from first menu option.

4. There's a new page called "Agent information". In it, you can set
following data:

- The agent type, being in this base module "External agent" the only
existing configuration. It can be extended with hr_commission
module for setting an "Employee" agent type.
- The associated commission type.
- The settlement period, where you can select "Bi-weekly", "Monthly",
"Quaterly", "Semi-annual" or "Annual".

You will also be able to see the settlements that have been made to
this agent from this page.

Usage
=====

For setting default agents in partners:

1. Go to *Invoicing > Customers > Customers* or *Contacts > Contacts*.
2. Edit or create a new record.
3. On "Sales & Purchases" page, you will see a field called "Agents"
where they can be added. You can put the number of agents you want,
but you can't select specific commission for each partner in this
base module.

For settling the commissions to agents:

1. Go to *Commissions > Settlements > Settle Commissions*.
2. On the window that appears, you should select the date up to which
you want to create commissions. It should be at least one day after
the last period date. For example, if you settlements are monthly,
you have to put at least the first day of the following month.
3. You can settle only certain agents if you select them on the "Agents"
section. Leave it empty for settling all.
4. Click on "Make settlements" button.
5. If there are new settlements, they will be shown after this.

Known issues / Roadmap
======================

- Make it totally multi-company aware.
- Set agent popup window with a kanban view with richer information and
mobile friendly.

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%0Aversion:%2018.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
-------

* Tecnativa

Contributors
------------

- Pexego.
- Davide Corio <davide.corio@domsense.com>
- Joao Alfredo Gama Batista <joao.gama@savoirfairelinux.com>
- Sandy Carter <sandy.carter@savoirfairelinux.com>
- Giorgio Borelli <giorgio.borelli@abstract.it>
- Daniel Campos <danielcampos@avanzosc.es>
- Oihane Crucelaegui <oihanecruce@gmail.com>
- Nicola Malcontenti <nicola.malcontenti@agilebg.com>
- Aitor Bouzas <aitor.bouzas@adaptivecity.com>
- Alexei Rivera <arivera@archeti.com>
- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Manuel Calero

- `Quartile <https://www.quartile.co>`__:

- Aung Ko Ko Lin
- Yoshi Tashiro

- `Studio73 <https://www.studio73.es>`__:

- Ethan Hildick

- Moaad Bourhim

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.

.. |maintainer-pedrobaeza| image:: https://github.com/pedrobaeza.png?size=40px
:target: https://github.com/pedrobaeza
:alt: pedrobaeza

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-pedrobaeza|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions commission/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
28 changes: 28 additions & 0 deletions commission/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2020 Tecnativa - Manuel Calero
# Copyright 2022 Quartile
# Copyright 2014-2022 Tecnativa - Pedro M. Baeza
{
"name": "Commissions",
"version": "18.0.1.1.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"category": "Invoicing",
"license": "AGPL-3",
"depends": ["product"],
"website": "https://github.com/OCA/commission",
"maintainers": ["pedrobaeza"],
"data": [
"security/commission_security.xml",
"security/ir.model.access.csv",
"data/menuitem_data.xml",
"views/commission_views.xml",
"views/commission_settlement_views.xml",
"views/commission_mixin_views.xml",
"views/product_template_views.xml",
"views/res_partner_views.xml",
"reports/commission_settlement_report.xml",
"reports/report_settlement_templates.xml",
"wizards/commission_make_settle_views.xml",
],
"demo": ["demo/commission_and_agent_demo.xml"],
"installable": True,
}
17 changes: 17 additions & 0 deletions commission/data/menuitem_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<menuitem
name="Commissions"
id="menu_commission"
groups="group_commission_user"
web_icon="commission,static/description/icon.png"
sequence="50"
/>
<menuitem
name="Configuration"
id="menu_commission_management"
parent="menu_commission"
groups="group_commission_manager"
sequence="100"
/>
</odoo>
36 changes: 36 additions & 0 deletions commission/demo/commission_and_agent_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" ?>
<odoo>
<!-- Create the Commission Types -->
<record id="demo_commission" model="commission">
<field name="name">10% fixed commission - Invoice Based</field>
<field name="fix_qty">10.0</field>
</record>
<!-- Create de Agents -->
<record id="res_partner_pritesh_sale_agent" model="res.partner">
<field name="name">Pritesh Sales Agent</field>
<field name="city">Ahmedabad</field>
<field name="zip">380007</field>
<field name="country_id" model="res.country" search="[('name','=','India')]" />
<field name="street">56 Beijing street</field>
<field name="agent" eval="1" />
<field name="commission_id" ref="demo_commission" />
</record>
<record id="res_partner_eiffel_sale_agent" model="res.partner">
<field name="name">Eiffel pvt ltd</field>
<field name="city">Ahmedabad</field>
<field name="zip">380007</field>
<field name="country_id" model="res.country" search="[('name','=','India')]" />
<field name="street">Wall Street 2</field>
<field name="agent" eval="1" />
<field name="commission_id" ref="demo_commission" />
</record>
<record id="res_partner_tiny_sale_agent" model="res.partner">
<field name="name">Tiny Belgium</field>
<field name="city">Belgium</field>
<field name="zip">2457</field>
<field name="country_id" model="res.country" search="[('name','=','India')]" />
<field name="street">Belgium Gao</field>
<field name="agent" eval="1" />
<field name="commission_id" ref="demo_commission" />
</record>
</odoo>
Loading
Loading