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

Syncing from upstream OCA/commission (17.0) #418

Merged
merged 66 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
eccb276
[MIG] sale_commission: Migration to 15.0
AungKoKoLin1997 Sep 19, 2022
cc6ccb7
[REF] *commission*: Abstract even more the base module
pedrobaeza Nov 19, 2022
4cf42e6
[IMP] commission*: Add settlement_type to commissions
pedrobaeza Dec 1, 2022
d2cf07e
[UPD] Update commission.pot
Dec 5, 2022
cfdca91
[UPD] README.rst
OCA-git-bot Dec 5, 2022
b7005c9
commission 15.0.2.0.0
OCA-git-bot Dec 5, 2022
7e31a1a
Added translation using Weblate (Japanese)
Ryoko04 Dec 6, 2022
9a86e08
Translated using Weblate (Japanese)
Ryoko04 Dec 6, 2022
dffd7bc
Translated using Weblate (Japanese)
Ryoko04 Dec 9, 2022
719a36e
Translated using Weblate (Japanese)
Ryoko04 Dec 16, 2022
0886434
[MIG] commission: Migration to 16.0
hildickethan Dec 26, 2022
6515852
[IMP] commission: Align dates in settlement view
hildickethan Dec 28, 2022
ccb2900
[UPD] Update commission.pot
Dec 28, 2022
1afc0a4
[UPD] README.rst
OCA-git-bot Dec 28, 2022
72d3577
Update translation files
weblate Dec 28, 2022
2980ff2
[UPD] Update commission.pot
Dec 30, 2022
370bd5e
Update translation files
weblate Dec 30, 2022
db2cd0a
[UPD] Update commission.pot
Jan 3, 2023
d20c230
Update translation files
weblate Jan 3, 2023
c5da911
[FIX] commission: Show full settlements table in partner
hildickethan Jan 10, 2023
c5c22e2
commission 16.0.1.1.0
OCA-git-bot Mar 3, 2023
046948c
[IMP] commission: Default commission_free instead of related
hildickethan Apr 26, 2023
1f54b2b
commission 16.0.1.1.1
OCA-git-bot May 2, 2023
cad2247
[IMP] commission: use mail thread and improve report
jguenat Jun 10, 2023
7bd6358
[UPD] Update commission.pot
Aug 18, 2023
0cdb250
commission 16.0.1.2.0
OCA-git-bot Aug 18, 2023
d0b0bf5
Update translation files
weblate Aug 18, 2023
cd3329b
[UPD] README.rst
OCA-git-bot Sep 3, 2023
8861425
[UPD] Update commission.pot
Sep 3, 2023
d2495ec
Update translation files
weblate Sep 3, 2023
016e4bf
Added translation using Weblate (Spanish)
Ivorra78 Sep 4, 2023
5de2968
Translated using Weblate (Spanish)
Ivorra78 Sep 4, 2023
296f83f
Added translation using Weblate (Italian)
dcorio Sep 15, 2023
e4b8cf6
Translated using Weblate (Italian)
dcorio Oct 5, 2023
ed4c8bd
Translated using Weblate (Italian)
francesco-ooops Oct 9, 2023
6686c84
Update translation files
weblate Oct 10, 2023
c646d79
Translated using Weblate (Italian)
mymage Oct 12, 2023
4ab36ee
Translated using Weblate (Italian)
mymage Oct 12, 2023
db39ed5
Translated using Weblate (Italian)
francesco-ooops Oct 13, 2023
745a805
Translated using Weblate (Italian)
mymage Oct 20, 2023
07728d7
Translated using Weblate (Italian)
dcorio Oct 24, 2023
69ed43e
[UPD] Update commission.pot
Oct 27, 2023
a9d68e9
Update translation files
weblate Oct 28, 2023
c17a7c4
Added translation using Weblate (Portuguese (Brazil))
adrianojprado Oct 29, 2023
d6e5152
Translated using Weblate (Portuguese (Brazil))
adrianojprado Oct 29, 2023
fd6393a
Added translation using Weblate (Portuguese)
pedrocs-exo Nov 13, 2023
dc50237
Translated using Weblate (Portuguese)
pedrocs-exo Nov 13, 2023
9b64c1b
Translated using Weblate (Portuguese)
pedrocs-exo Nov 13, 2023
47b231f
[IMP] account_commission: multi-currency support
alexeirivera87 Mar 14, 2023
cf6b5ae
[FIXUP] improvements based on review
jguenat Aug 22, 2023
e76c854
[BOT] post-merge updates
OCA-git-bot Nov 24, 2023
0c2ef6f
Translated using Weblate (Italian)
mymage Nov 30, 2023
f65e3d5
Translated using Weblate (Italian)
francesco-ooops Dec 14, 2023
b894f34
[IMP] commission: Clarify selection fields
renda-dev Dec 18, 2023
f98e2c6
[UPD] Update commission.pot
Dec 18, 2023
4cae951
[BOT] post-merge updates
OCA-git-bot Dec 18, 2023
38758cb
Update translation files
weblate Dec 18, 2023
d01266b
Translated using Weblate (Spanish)
Ivorra78 Dec 18, 2023
9cd0c72
Translated using Weblate (Italian)
mymage Dec 27, 2023
257ef2b
Translated using Weblate (Portuguese (Brazil))
adrianojprado Dec 28, 2023
9abb6c0
[MIG] commission: Migration to 17.0
ambientWave Jan 19, 2024
e14f5d8
[IMP] commission: pre-commit auto fixes
ambientWave Apr 19, 2024
93a0dee
Merge PR #497 into 17.0
OCA-git-bot Apr 19, 2024
a875c48
[UPD] Update commission.pot
Apr 19, 2024
1d27879
[BOT] post-merge updates
OCA-git-bot Apr 19, 2024
e6fea5c
Update translation files
weblate Apr 19, 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
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ TODO: add repo description.

[//]: # (addons)

This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools.
Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[commission](commission/) | 17.0.1.0.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Commissions

[//]: # (end addons)

Expand Down
192 changes: 192 additions & 0 deletions commission/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
===========
Commissions
===========

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

.. |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/17.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-17-0/commission-17-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=17.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:%2017.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 <[email protected]>
- Joao Alfredo Gama Batista <[email protected]>
- Sandy Carter <[email protected]>
- Giorgio Borelli <[email protected]>
- Daniel Campos <[email protected]>
- Oihane Crucelaegui <[email protected]>
- Nicola Malcontenti <[email protected]>
- Aitor Bouzas <[email protected]>
- Alexei Rivera <[email protected]>
- `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

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/17.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": "17.0.1.0.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