Skip to content

Commit

Permalink
Merge pull request #479 from OCA/15.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/commission (15.0)
  • Loading branch information
bt-admin authored Aug 9, 2024
2 parents 51fa7f4 + 40491a3 commit 001b6fd
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.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
[sale_commission](sale_commission/) | 15.0.2.1.1 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Sales commissions
Expand Down
2 changes: 1 addition & 1 deletion account_commission/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:0e0fd65289aeddebd4759567566b4e2b2221c76b50dedc95e7da15c899e13fec
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion account_commission/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.2",
"author": "Tecnativa, Odoo Community Association (OCA)",
"category": "Sales Management",
"license": "AGPL-3",
Expand Down
4 changes: 3 additions & 1 deletion account_commission/models/commission_settlement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 8 additions & 5 deletions account_commission/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -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 }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">Account commissions</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a54acf8b8311d933604140598d1a26f163fdfe5fdd0545e4456aeb1501d352a9
!! source digest: sha256:0e0fd65289aeddebd4759567566b4e2b2221c76b50dedc95e7da15c899e13fec
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/commission/tree/15.0/account_commission"><img alt="OCA/commission" src="https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/commission-15-0/commission-15-0-account_commission"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/commission&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the function to calculate commissions in invoices (account moves).</p>
Expand Down Expand Up @@ -486,7 +487,9 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down
2 changes: 1 addition & 1 deletion account_commission/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
attrs="{'invisible': [('agent_ids', '=', [])], 'readonly': [('any_settled', '=', True)]}"
>
<field name="any_settled" invisible="1" />
<field name="commission_free" force_save="1" />
<field name="commission_free" force_save="1" readonly="1" />
<field
name="agent_ids"
attrs="{'readonly': [('commission_free', '=', True)]}"
Expand Down
2 changes: 1 addition & 1 deletion commission/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion commission/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 7 additions & 2 deletions commission/models/commission_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class CommissionMixin(models.AbstractModel):
product_id = fields.Many2one(comodel_name="product.product", string="Product")
commission_free = fields.Boolean(
string="Comm. free",
related="product_id.commission_free",
compute="_compute_commission_free",
store=True,
readonly=True,
readonly=False,
)
commission_status = fields.Char(
compute="_compute_commission_status",
Expand All @@ -45,6 +45,11 @@ def _prepare_agents_vals_partner(self, partner, settlement_type=None):
)
return [(0, 0, self._prepare_agent_vals(agent)) for agent in agents]

@api.depends("product_id")
def _compute_commission_free(self):
for record in self:
record.commission_free = record.product_id.commission_free

@api.depends("commission_free")
def _compute_agent_ids(self):
"""Empty method that needs to be implemented in children models."""
Expand Down
13 changes: 8 additions & 5 deletions commission/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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.
Expand Down Expand Up @@ -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 }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">Commissions</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c18bdd38fbb8f3a90d7b754467566cabb6c5db963402c1b26c132bb8ca3c62d8
!! source digest: sha256:6fad540f527f5734bbfba5d3387edda421579082dcbf3ad44d1fee7e14cf59e2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/commission/tree/15.0/commission"><img alt="OCA/commission" src="https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/commission-15-0/commission-15-0-commission"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/commission&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides the base functions for commission operations to enable the
Expand Down Expand Up @@ -516,7 +517,9 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>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.</p>
Expand Down

0 comments on commit 001b6fd

Please sign in to comment.