From 7a81ee50dff0acb8b0b102a81271c1296cce318a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 8 Aug 2024 11:08:45 +0200 Subject: [PATCH 1/5] [FIX] *commission: Remove related from commission_free Steps to reproduce: - Create a product commission free. - Do some invoices with that product. - There's no commission on the invoices. - Remove the "Commission free" check. Result: all the past invoices are recomputed and now a commission appears. That's not acceptable, as past things shouldn't be changed if you change the definition from now on, and more if you already did the settlements. This happens because the field in the invoice line is a related one, so changing the source, recomputes all the linked records. Let's change it to a computed writable, being recomputed only when the product changes, not if we change the . TT50445 --- account_commission/views/account_move_views.xml | 2 +- commission/models/commission_mixin.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/account_commission/views/account_move_views.xml b/account_commission/views/account_move_views.xml index b0954ffa2..7da7cdf3a 100644 --- a/account_commission/views/account_move_views.xml +++ b/account_commission/views/account_move_views.xml @@ -31,7 +31,7 @@ attrs="{'invisible': [('agent_ids', '=', [])], 'readonly': [('any_settled', '=', True)]}" > - + Date: Thu, 8 Aug 2024 09:49:52 +0000 Subject: [PATCH 2/5] [BOT] post-merge updates --- README.md | 4 ++-- account_commission/README.rst | 2 +- account_commission/__manifest__.py | 2 +- account_commission/static/description/index.html | 13 ++++++++----- commission/README.rst | 2 +- commission/__manifest__.py | 2 +- commission/static/description/index.html | 13 ++++++++----- 7 files changed, 22 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e2a23c743..c7de0f854 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[account_commission](account_commission/) | 15.0.3.3.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Account commissions -[commission](commission/) | 15.0.3.2.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Commissions +[account_commission](account_commission/) | 15.0.3.3.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Account commissions +[commission](commission/) | 15.0.3.2.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Commissions [commission_formula](commission_formula/) | 15.0.1.0.0 | | Commissions computed by formulas [hr_commission](hr_commission/) | 15.0.1.0.1 | | HR commissions [sale_commission](sale_commission/) | 15.0.2.1.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Sales commissions diff --git a/account_commission/README.rst b/account_commission/README.rst index 7c7f8c8ee..7e313e399 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:a54acf8b8311d933604140598d1a26f163fdfe5fdd0545e4456aeb1501d352a9 + !! source digest: sha256:3458893c850a5d11a9b824a1d4ab58f867561d2f64dc17514126eca224b036ba !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/account_commission/__manifest__.py b/account_commission/__manifest__.py index b85809fc1..7ad384c1d 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": "15.0.3.3.0", + "version": "15.0.3.3.1", "author": "Tecnativa, Odoo Community Association (OCA)", "category": "Sales Management", "license": "AGPL-3", diff --git a/account_commission/static/description/index.html b/account_commission/static/description/index.html index 62c9646ab..fb0ddc2a7 100644 --- a/account_commission/static/description/index.html +++ b/account_commission/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -366,7 +367,7 @@

Account commissions

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:a54acf8b8311d933604140598d1a26f163fdfe5fdd0545e4456aeb1501d352a9 +!! source digest: sha256:3458893c850a5d11a9b824a1d4ab58f867561d2f64dc17514126eca224b036ba !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/commission Translate me on Weblate Try me on Runboat

This module adds the function to calculate commissions in invoices (account moves).

@@ -486,7 +487,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.

diff --git a/commission/README.rst b/commission/README.rst index a32499f25..565b335b3 100644 --- a/commission/README.rst +++ b/commission/README.rst @@ -7,7 +7,7 @@ Commissions !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:c18bdd38fbb8f3a90d7b754467566cabb6c5db963402c1b26c132bb8ca3c62d8 + !! source digest: sha256:6fad540f527f5734bbfba5d3387edda421579082dcbf3ad44d1fee7e14cf59e2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/commission/__manifest__.py b/commission/__manifest__.py index 5eb58e5ae..ef1caf5da 100644 --- a/commission/__manifest__.py +++ b/commission/__manifest__.py @@ -3,7 +3,7 @@ # Copyright 2014-2022 Tecnativa - Pedro M. Baeza { "name": "Commissions", - "version": "15.0.3.2.0", + "version": "15.0.3.2.1", "author": "Tecnativa, Odoo Community Association (OCA)", "category": "Invoicing", "license": "AGPL-3", diff --git a/commission/static/description/index.html b/commission/static/description/index.html index bd2d38302..6ef647473 100644 --- a/commission/static/description/index.html +++ b/commission/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -366,7 +367,7 @@

Commissions

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:c18bdd38fbb8f3a90d7b754467566cabb6c5db963402c1b26c132bb8ca3c62d8 +!! source digest: sha256:6fad540f527f5734bbfba5d3387edda421579082dcbf3ad44d1fee7e14cf59e2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/commission Translate me on Weblate Try me on Runboat

This module provides the base functions for commission operations to enable the @@ -516,7 +517,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.

From 1d3a71942bc928f570caf3900216768980e1251a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 8 Aug 2024 12:09:30 +0200 Subject: [PATCH 3/5] [IMP] account_commission: Index on invoice_agent_line_id That way, deletions of agent lines in invoices are faster. --- account_commission/__manifest__.py | 2 +- account_commission/models/commission_settlement.py | 4 +++- account_commission/static/description/index.html | 11 ++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/account_commission/__manifest__.py b/account_commission/__manifest__.py index 7ad384c1d..8fc90a154 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": "15.0.3.3.1", + "version": "15.0.3.3.2", "author": "Tecnativa, Odoo Community Association (OCA)", "category": "Sales Management", "license": "AGPL-3", diff --git a/account_commission/models/commission_settlement.py b/account_commission/models/commission_settlement.py index 6984def2a..65be53628 100644 --- a/account_commission/models/commission_settlement.py +++ b/account_commission/models/commission_settlement.py @@ -158,7 +158,9 @@ def make_invoices(self, journal, product, date=False, grouped=False): class SettlementLine(models.Model): _inherit = "commission.settlement.line" - invoice_agent_line_id = fields.Many2one(comodel_name="account.invoice.line.agent") + invoice_agent_line_id = fields.Many2one( + comodel_name="account.invoice.line.agent", index=True + ) invoice_line_id = fields.Many2one( comodel_name="account.move.line", store=True, diff --git a/account_commission/static/description/index.html b/account_commission/static/description/index.html index fb0ddc2a7..2065dd515 100644 --- a/account_commission/static/description/index.html +++ b/account_commission/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. -Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +274,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +300,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -487,9 +486,7 @@

Contributors

Maintainers

This module is maintained by the OCA.

- -Odoo Community Association - +Odoo Community Association

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.

From ff36da12c403be588c3a04777d1233418c5a2608 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 8 Aug 2024 10:10:25 +0000 Subject: [PATCH 4/5] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c7de0f854..f871c37f0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Available addons ---------------- addon | version | maintainers | summary --- | --- | --- | --- -[account_commission](account_commission/) | 15.0.3.3.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Account commissions +[account_commission](account_commission/) | 15.0.3.3.2 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Account commissions [commission](commission/) | 15.0.3.2.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Commissions [commission_formula](commission_formula/) | 15.0.1.0.0 | | Commissions computed by formulas [hr_commission](hr_commission/) | 15.0.1.0.1 | | HR commissions From 40491a3c2b1d86d6a3ab28a7e0997e3f8f907216 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 8 Aug 2024 10:10:25 +0000 Subject: [PATCH 5/5] [UPD] README.rst --- account_commission/README.rst | 2 +- account_commission/static/description/index.html | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/account_commission/README.rst b/account_commission/README.rst index 7e313e399..0706f0165 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:3458893c850a5d11a9b824a1d4ab58f867561d2f64dc17514126eca224b036ba + !! source digest: sha256:0e0fd65289aeddebd4759567566b4e2b2221c76b50dedc95e7da15c899e13fec !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/account_commission/static/description/index.html b/account_commission/static/description/index.html index 2065dd515..bd6246931 100644 --- a/account_commission/static/description/index.html +++ b/account_commission/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -366,7 +367,7 @@

Account commissions

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:3458893c850a5d11a9b824a1d4ab58f867561d2f64dc17514126eca224b036ba +!! source digest: sha256:0e0fd65289aeddebd4759567566b4e2b2221c76b50dedc95e7da15c899e13fec !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/commission Translate me on Weblate Try me on Runboat

This module adds the function to calculate commissions in invoices (account moves).

@@ -486,7 +487,9 @@

Contributors

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

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.