diff --git a/README.md b/README.md index 600f3ca25..7f6d0e4ff 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[account_commission](account_commission/) | 16.0.2.2.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Account commissions +[account_commission](account_commission/) | 16.0.2.2.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Account commissions [commission](commission/) | 16.0.2.1.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Commissions [commission_formula](commission_formula/) | 16.0.1.0.0 | | Commissions computed by formulas [hr_commission](hr_commission/) | 16.0.1.0.0 | | HR commissions -[sale_commission](sale_commission/) | 16.0.1.0.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Sales commissions +[sale_commission](sale_commission/) | 16.0.1.0.2 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Sales commissions [sale_commission_product_criteria](sale_commission_product_criteria/) | 16.0.1.0.0 | [![ilyasProgrammer](https://github.com/ilyasProgrammer.png?size=30px)](https://github.com/ilyasProgrammer) | Advanced commissions rules [sale_commission_salesman](sale_commission_salesman/) | 16.0.1.0.0 | | Sales commissions from salesman diff --git a/account_commission/README.rst b/account_commission/README.rst index eb47edde7..7370a3c5a 100644 --- a/account_commission/README.rst +++ b/account_commission/README.rst @@ -7,7 +7,7 @@ Account commissions !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:aebcf65d67c56dd22612b39b8beddce430bbf62d966760b7e5381d914fe4cb14 + !! source digest: sha256:77299b3b65fc7979bfd7818c3aed06a5912134599c1e0469f00ed5f220b2b5be !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -47,7 +47,9 @@ For selecting invoice status in commissions: #. Edit or create a new record to select the invoice status for settling the commissions. * **Invoice Based**: Commissions are settled when the invoice is issued. - * **Payment Based**: Commissions are settled when the invoice is paid. + * **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. Usage ===== diff --git a/account_commission/__manifest__.py b/account_commission/__manifest__.py index 71703c2cc..0e630c324 100644 --- a/account_commission/__manifest__.py +++ b/account_commission/__manifest__.py @@ -3,7 +3,7 @@ # Copyright 2014-2022 Tecnativa - Pedro M. Baeza { "name": "Account commissions", - "version": "16.0.2.2.0", + "version": "16.0.2.2.1", "author": "Tecnativa, Odoo Community Association (OCA)", "category": "Sales Management", "license": "AGPL-3", diff --git a/account_commission/i18n/account_commission.pot b/account_commission/i18n/account_commission.pot index f49c0c6a5..96dd6f6aa 100644 --- a/account_commission/i18n/account_commission.pot +++ b/account_commission/i18n/account_commission.pot @@ -439,7 +439,7 @@ msgstr "" msgid "" "Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" -"* 'Payment Based': Commissions are settled when the invoice is paid." +"* 'Payment Based': Commissions are settled when the invoice is paid (or refunded)." msgstr "" #. module: account_commission diff --git a/account_commission/i18n/es.po b/account_commission/i18n/es.po index 9f0d98afd..f98c53aee 100644 --- a/account_commission/i18n/es.po +++ b/account_commission/i18n/es.po @@ -442,12 +442,9 @@ msgstr "Facturas de Ventas" msgid "" "Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" -"* 'Payment Based': Commissions are settled when the invoice is paid." +"* 'Payment Based': Commissions are settled when the invoice is paid (or " +"refunded)." msgstr "" -"Seleccione el estado de la factura para liquidar las comisiones:\n" -"* 'Basado en factura': Las comisiones se liquidan cuando se emite la " -"factura.\n" -"* Pago\": Las comisiones se liquidan cuando se paga la factura." #. module: account_commission #: model:ir.model.fields,field_description:account_commission.field_account_invoice_line_agent__settled @@ -595,5 +592,15 @@ msgstr "Análisis de comisión facturada" msgid "invoices Commission Analysis" msgstr "Análisis de Comisiones facturadas" +#~ msgid "" +#~ "Select the invoice status for settling the commissions:\n" +#~ "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" +#~ "* 'Payment Based': Commissions are settled when the invoice is paid." +#~ msgstr "" +#~ "Seleccione el estado de la factura para liquidar las comisiones:\n" +#~ "* 'Basado en factura': Las comisiones se liquidan cuando se emite la " +#~ "factura.\n" +#~ "* Pago\": Las comisiones se liquidan cuando se paga la factura." + #~ msgid "_Cancel" #~ msgstr "_Cancelar" diff --git a/account_commission/i18n/hr.po b/account_commission/i18n/hr.po index c71e8053b..2b237bec3 100644 --- a/account_commission/i18n/hr.po +++ b/account_commission/i18n/hr.po @@ -441,7 +441,8 @@ msgstr "" msgid "" "Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" -"* 'Payment Based': Commissions are settled when the invoice is paid." +"* 'Payment Based': Commissions are settled when the invoice is paid (or " +"refunded)." msgstr "" #. module: account_commission diff --git a/account_commission/i18n/it.po b/account_commission/i18n/it.po index 9e89c9974..f6123f907 100644 --- a/account_commission/i18n/it.po +++ b/account_commission/i18n/it.po @@ -451,7 +451,8 @@ msgstr "Fatture di vendita" msgid "" "Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" -"* 'Payment Based': Commissions are settled when the invoice is paid." +"* 'Payment Based': Commissions are settled when the invoice is paid (or " +"refunded)." msgstr "" #. module: account_commission diff --git a/account_commission/i18n/ja.po b/account_commission/i18n/ja.po index 8d7ac5fbe..adcc0c294 100644 --- a/account_commission/i18n/ja.po +++ b/account_commission/i18n/ja.po @@ -442,7 +442,8 @@ msgstr "販売請求書" msgid "" "Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" -"* 'Payment Based': Commissions are settled when the invoice is paid." +"* 'Payment Based': Commissions are settled when the invoice is paid (or " +"refunded)." msgstr "" #. module: account_commission diff --git a/account_commission/i18n/pt.po b/account_commission/i18n/pt.po index 82050c0ed..cf1ccadbd 100644 --- a/account_commission/i18n/pt.po +++ b/account_commission/i18n/pt.po @@ -442,7 +442,8 @@ msgstr "Faturas de Vendas" msgid "" "Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" -"* 'Payment Based': Commissions are settled when the invoice is paid." +"* 'Payment Based': Commissions are settled when the invoice is paid (or " +"refunded)." msgstr "" #. module: account_commission diff --git a/account_commission/i18n/pt_BR.po b/account_commission/i18n/pt_BR.po index de33a6f0e..2c3df8e15 100644 --- a/account_commission/i18n/pt_BR.po +++ b/account_commission/i18n/pt_BR.po @@ -442,7 +442,8 @@ msgstr "Faturas de Vendas" msgid "" "Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" -"* 'Payment Based': Commissions are settled when the invoice is paid." +"* 'Payment Based': Commissions are settled when the invoice is paid (or " +"refunded)." msgstr "" #. module: account_commission diff --git a/account_commission/models/commission.py b/account_commission/models/commission.py index 5367c96db..964bf63bb 100644 --- a/account_commission/models/commission.py +++ b/account_commission/models/commission.py @@ -12,5 +12,5 @@ class Commission(models.Model): default="open", help="Select the invoice status for settling the commissions:\n" "* 'Invoice Based': Commissions are settled when the invoice is issued.\n" - "* 'Payment Based': Commissions are settled when the invoice is paid.", + "* 'Payment Based': Commissions are settled when the invoice is paid (or refunded).", ) diff --git a/account_commission/readme/CONFIGURE.rst b/account_commission/readme/CONFIGURE.rst index 78d97059d..04e0739b6 100644 --- a/account_commission/readme/CONFIGURE.rst +++ b/account_commission/readme/CONFIGURE.rst @@ -3,4 +3,6 @@ For selecting invoice status in commissions: #. Edit or create a new record to select the invoice status for settling the commissions. * **Invoice Based**: Commissions are settled when the invoice is issued. - * **Payment Based**: Commissions are settled when the invoice is paid. + * **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. diff --git a/account_commission/static/description/index.html b/account_commission/static/description/index.html index 92324729f..37a0eb141 100644 --- a/account_commission/static/description/index.html +++ b/account_commission/static/description/index.html @@ -366,7 +366,7 @@
This module adds the function to calculate commissions in invoices (account moves).
@@ -392,7 +392,9 @@This module adds the function to calculate commissions in sales orders.
diff --git a/sale_commission/tests/test_sale_commission.py b/sale_commission/tests/test_sale_commission.py index 735b93481..f3898f52c 100644 --- a/sale_commission/tests/test_sale_commission.py +++ b/sale_commission/tests/test_sale_commission.py @@ -15,6 +15,13 @@ class TestSaleCommission(TestAccountCommission): @classmethod def setUpClass(cls): super().setUpClass() + cls.pricelist = cls.env["product.pricelist"].create( + { + "name": "Pricelist for tests", + "currency_id": cls.company.currency_id.id, + } + ) + cls.partner.property_product_pricelist = cls.pricelist cls.sale_order_model = cls.env["sale.order"] cls.advance_inv_model = cls.env["sale.advance.payment.inv"] cls.product.write({"invoice_policy": "order"})