Maintainers
+Maintainers
This module is maintained by the OCA.
@@ -509,6 +509,5 @@ diff --git a/account_commission/README.rst b/account_commission/README.rst index 05b42af32..05dee50dc 100644 --- a/account_commission/README.rst +++ b/account_commission/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - =================== Account commissions =================== @@ -17,7 +13,7 @@ Account commissions .. |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 +.. |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 @@ -55,6 +51,12 @@ For selecting invoice status in commissions: Note that when refunding an invoice, the corresponding reversed commission will be settled as well, resulting in a 0 net commission between both operations. +#. For payment-based commissions, you can choose how settlements are grouped. +By default, they’re grouped by 'Invoice Date', but you can also group them +by 'Payment Date'. +For example, if you select 'Payment Date', all commissions +related to payments made on the same period will be grouped together in a single settlement. + Usage ===== diff --git a/account_commission/models/commission.py b/account_commission/models/commission.py index 964bf63bb..88c07fe39 100644 --- a/account_commission/models/commission.py +++ b/account_commission/models/commission.py @@ -14,3 +14,8 @@ class Commission(models.Model): "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" "* 'Payment Based': Commissions are settled when the invoice is paid (or refunded).", ) + settled_dates_based_on = fields.Selection( + [("inv", "Invoice Date"), ("payment", "Payment Date")], + default="inv", + help="Select the date to use for settling the commissions:\n", + ) diff --git a/account_commission/models/commission_settlement.py b/account_commission/models/commission_settlement.py index 9f9b94509..7697118bc 100644 --- a/account_commission/models/commission_settlement.py +++ b/account_commission/models/commission_settlement.py @@ -34,6 +34,13 @@ class CommissionSettlement(models.Model): comodel_name="account.move", compute="_compute_invoice_id", ) + commission_grouped_by = fields.Selection( + related="agent_id.commission_id.settled_dates_based_on", + string="Commission By", + help="Shows the field by which the commissions have been grouped.", + store=True, + readonly=True, + ) def _compute_can_edit(self): """Make settlements coming from invoice lines to not be editable.""" diff --git a/account_commission/readme/CONFIGURE.rst b/account_commission/readme/CONFIGURE.rst index 04e0739b6..170bbd2a1 100644 --- a/account_commission/readme/CONFIGURE.rst +++ b/account_commission/readme/CONFIGURE.rst @@ -6,3 +6,9 @@ For selecting invoice status in commissions: * **Payment Based**: Commissions are settled when the invoice is paid or refunded. Note that when refunding an invoice, the corresponding reversed commission will be settled as well, resulting in a 0 net commission between both operations. + +#. For payment-based commissions, you can choose how settlements are grouped. +By default, they’re grouped by 'Invoice Date', but you can also group them +by 'Payment Date'. +For example, if you select 'Payment Date', all commissions +related to payments made on the same period will be grouped together in a single settlement. diff --git a/account_commission/static/description/index.html b/account_commission/static/description/index.html index 978a99999..659bdd47a 100644 --- a/account_commission/static/description/index.html +++ b/account_commission/static/description/index.html @@ -3,7 +3,7 @@
-This module adds the function to calculate commissions in invoices (account moves).
It also allows to create vendor bills from settlements for external agents.
This module depends on the commission module.
@@ -393,7 +388,7 @@For selecting invoice status in commissions:
#. For payment-based commissions, you can choose how settlements are grouped. +By default, they’re grouped by ‘Invoice Date’, but you can also group them +by ‘Payment Date’. +For example, if you select ‘Payment Date’, all commissions +related to payments made on the same period will be grouped together in a single settlement.
For adding commissions on invoices:
Bugs are tracked on GitHub 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 @@ -456,15 +456,15 @@
Do not contact contributors directly about support or help with technical issues.