Skip to content

Commit

Permalink
Merge pull request #472 from OCA/14.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/commission (14.0)
  • Loading branch information
bt-admin authored Jul 19, 2024
2 parents ae9ef73 + 0207d7f commit 37f9105
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ addon | version | maintainers | summary
[sale_commission](sale_commission/) | 14.0.1.8.0 | [![pedrobaeza](https://github.com/pedrobaeza.png?size=30px)](https://github.com/pedrobaeza) | Sales commissions
[sale_commission_advance](sale_commission_advance/) | 14.0.1.0.0 | [![ilyasprogrammer](https://github.com/ilyasprogrammer.png?size=30px)](https://github.com/ilyasprogrammer) | Down payment invoice commission
[sale_commission_agent_restrict](sale_commission_agent_restrict/) | 14.0.2.0.2 | [![aleuffre](https://github.com/aleuffre.png?size=30px)](https://github.com/aleuffre) | Sales Commissions Agent Restrict
[sale_commission_check_deposit](sale_commission_check_deposit/) | 14.0.1.0.0 | | Sales commission check deposit
[sale_commission_check_deposit](sale_commission_check_deposit/) | 14.0.1.0.1 | [![aleuffre](https://github.com/aleuffre.png?size=30px)](https://github.com/aleuffre) [![renda-dev](https://github.com/renda-dev.png?size=30px)](https://github.com/renda-dev) [![PicchiSeba](https://github.com/PicchiSeba.png?size=30px)](https://github.com/PicchiSeba) | Sales commission check deposit
[sale_commission_delegated_partner](sale_commission_delegated_partner/) | 14.0.1.0.1 | | Allow to delegate the invoices of agent to a delegate partner
[sale_commission_formula](sale_commission_formula/) | 14.0.1.0.0 | | Sale commissions computed by formulas
[sale_commission_geo_assign](sale_commission_geo_assign/) | 14.0.1.1.3 | [![eLBati](https://github.com/eLBati.png?size=30px)](https://github.com/eLBati) [![aleuffre](https://github.com/aleuffre.png?size=30px)](https://github.com/aleuffre) [![renda-dev](https://github.com/renda-dev.png?size=30px)](https://github.com/renda-dev) [![PicchiSeba](https://github.com/PicchiSeba.png?size=30px)](https://github.com/PicchiSeba) | Assign agents to partners according to their location
Expand Down
42 changes: 34 additions & 8 deletions sale_commission_check_deposit/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Sales commission check deposit
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ba0fd3fb9a685120806a47d8a736cf09ff9221c5c2dfb2735cbbbaacb249d517
!! source digest: sha256:ef75d4baed76b11976c31f40a0c85034baef2b0ed77b2137f5c1a5ca2b59fc8a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -30,10 +30,23 @@ Sales commission check deposit

The module allows you to integrate check deposit with agent commissions.

When generating agent commissions, an invoice with checks payment
will be taken into consideration only after the number of days set in
the "Safety Days" field in journal configuration from due date set in
check payment.
When generating agent settlements, select a
payment date until which commissions should be settled.

Invoices with checks payment will be taken
into consideration only if the number of
days set in the "Safety days for commission"
field in journal configuration from due date
set in check payment have passed from settlement payment date.

Eg:

- Invoice 0001 is paid with check
- Check due date: January 1st
- "Safety days for commission" set in check journal: 10
- In settlement wizard:
- Settle commissions until payment date: January 5th => commission is not settled for check
- Settle commissions until payment date: January 15th => commission is settled for check

**Table of contents**

Expand All @@ -52,7 +65,6 @@ For pay and register a checks deposit:

#. Create an invoice and using Checks to pay it.
#. Add a new checks deposit adding that payment.
#. Validate checks deposit.

For settling the commissions to agents:

Expand All @@ -64,8 +76,8 @@ For settling the commissions to agents:
#. You can settle only certain agents if you select them on the "Agents"
section. Leave it empty for settling all.
#. Click on "Make settlements" button.
#. If safety days have passed from due date set in checks payment commission will be
settled properly.
#. If safety days have passed between settlement payment date and check due date,
commission will be settled properly.

Bug Tracker
===========
Expand Down Expand Up @@ -103,6 +115,20 @@ 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-aleuffre| image:: https://github.com/aleuffre.png?size=40px
:target: https://github.com/aleuffre
:alt: aleuffre
.. |maintainer-renda-dev| image:: https://github.com/renda-dev.png?size=40px
:target: https://github.com/renda-dev
:alt: renda-dev
.. |maintainer-PicchiSeba| image:: https://github.com/PicchiSeba.png?size=40px
:target: https://github.com/PicchiSeba
:alt: PicchiSeba

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-aleuffre| |maintainer-renda-dev| |maintainer-PicchiSeba|

This module is part of the `OCA/commission <https://github.com/OCA/commission/tree/14.0/sale_commission_check_deposit>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion sale_commission_check_deposit/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright 2023 Nextev Srl
{
"name": "Sales commission check deposit",
"version": "14.0.1.0.0",
"version": "14.0.1.0.1",
"author": "Nextev Srl," "Odoo Community Association (OCA)",
"maintainers": ["aleuffre", "renda-dev", "PicchiSeba"],
"category": "Sales Management",
"license": "AGPL-3",
"depends": [
Expand Down
12 changes: 10 additions & 2 deletions sale_commission_check_deposit/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: sale_commission_check_deposit
#: model:ir.model.fields,help:sale_commission_check_deposit.field_account_journal__safety_days
msgid "Days after expiration date for commission settlement"
msgstr ""

#. module: sale_commission_check_deposit
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_account_journal__display_name
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_sale_commission_make_settle__display_name
Expand Down Expand Up @@ -46,10 +51,13 @@ msgstr "Última Modificación el"

#. module: sale_commission_check_deposit
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_account_journal__safety_days
msgid "Safety Days"
msgstr "Jornadas de Seguridad"
msgid "Safety days for commission"
msgstr ""

#. module: sale_commission_check_deposit
#: model:ir.model,name:sale_commission_check_deposit.model_sale_commission_make_settle
msgid "Wizard for settling commissions in invoices"
msgstr "Asistente para liquidar comisiones en facturas"

#~ msgid "Safety Days"
#~ msgstr "Jornadas de Seguridad"
12 changes: 10 additions & 2 deletions sale_commission_check_deposit/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: sale_commission_check_deposit
#: model:ir.model.fields,help:sale_commission_check_deposit.field_account_journal__safety_days
msgid "Days after expiration date for commission settlement"
msgstr ""

#. module: sale_commission_check_deposit
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_account_journal__display_name
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_sale_commission_make_settle__display_name
Expand Down Expand Up @@ -46,10 +51,13 @@ msgstr "Ultima modifica il"

#. module: sale_commission_check_deposit
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_account_journal__safety_days
msgid "Safety Days"
msgstr "Giorni di sicurezza"
msgid "Safety days for commission"
msgstr ""

#. module: sale_commission_check_deposit
#: model:ir.model,name:sale_commission_check_deposit.model_sale_commission_make_settle
msgid "Wizard for settling commissions in invoices"
msgstr "Procedura per regolare le provvigioni nelle fatture"

#~ msgid "Safety Days"
#~ msgstr "Giorni di sicurezza"
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_commission_check_deposit
#: model:ir.model.fields,help:sale_commission_check_deposit.field_account_journal__safety_days
msgid "Days after expiration date for commission settlement"
msgstr ""

#. module: sale_commission_check_deposit
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_account_journal__display_name
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_sale_commission_make_settle__display_name
Expand Down Expand Up @@ -43,7 +48,7 @@ msgstr ""

#. module: sale_commission_check_deposit
#: model:ir.model.fields,field_description:sale_commission_check_deposit.field_account_journal__safety_days
msgid "Safety Days"
msgid "Safety days for commission"
msgstr ""

#. module: sale_commission_check_deposit
Expand Down
6 changes: 5 additions & 1 deletion sale_commission_check_deposit/models/account_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ class AccountJournal(models.Model):
_inherit = "account.journal"

is_check_journal = fields.Boolean()
safety_days = fields.Integer(default=5)
safety_days = fields.Integer(
string="Safety days for commission",
help="Days after expiration date for commission settlement",
default=5,
)
21 changes: 17 additions & 4 deletions sale_commission_check_deposit/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
The module allows you to integrate check deposit with agent commissions.

When generating agent commissions, an invoice with checks payment
will be taken into consideration only after the number of days set in
the "Safety Days" field in journal configuration from due date set in
check payment.
When generating agent settlements, select a
payment date until which commissions should be settled.

Invoices with checks payment will be taken
into consideration only if the number of
days set in the "Safety days for commission"
field in journal configuration from due date
set in check payment have passed from settlement payment date.

Eg:

- Invoice 0001 is paid with check
- Check due date: January 1st
- "Safety days for commission" set in check journal: 10
- In settlement wizard:
- Settle commissions until payment date: January 5th => commission is not settled for check
- Settle commissions until payment date: January 15th => commission is settled for check
5 changes: 2 additions & 3 deletions sale_commission_check_deposit/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ For pay and register a checks deposit:

#. Create an invoice and using Checks to pay it.
#. Add a new checks deposit adding that payment.
#. Validate checks deposit.

For settling the commissions to agents:

Expand All @@ -19,5 +18,5 @@ For settling the commissions to agents:
#. You can settle only certain agents if you select them on the "Agents"
section. Leave it empty for settling all.
#. Click on "Make settlements" button.
#. If safety days have passed from due date set in checks payment commission will be
settled properly.
#. If safety days have passed between settlement payment date and check due date,
commission will be settled properly.
50 changes: 34 additions & 16 deletions sale_commission_check_deposit/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,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 @@ -275,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 @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

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

span.section-subtitle {
Expand Down Expand Up @@ -367,14 +367,32 @@ <h1 class="title">Sales commission check deposit</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ba0fd3fb9a685120806a47d8a736cf09ff9221c5c2dfb2735cbbbaacb249d517
!! source digest: sha256:ef75d4baed76b11976c31f40a0c85034baef2b0ed77b2137f5c1a5ca2b59fc8a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/14.0/sale_commission_check_deposit"><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-14-0/commission-14-0-sale_commission_check_deposit"><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=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>The module allows you to integrate check deposit with agent commissions.</p>
<p>When generating agent commissions, an invoice with checks payment
will be taken into consideration only after the number of days set in
the “Safety Days” field in journal configuration from due date set in
check payment.</p>
<p>When generating agent settlements, select a
payment date until which commissions should be settled.</p>
<p>Invoices with checks payment will be taken
into consideration only if the number of
days set in the “Safety days for commission”
field in journal configuration from due date
set in check payment have passed from settlement payment date.</p>
<p>Eg:</p>
<ul class="simple">
<li>Invoice 0001 is paid with check</li>
<li>Check due date: January 1st</li>
<li>“Safety days for commission” set in check journal: 10</li>
<li><dl class="first docutils">
<dt>In settlement wizard:</dt>
<dd><ul class="first last">
<li>Settle commissions until payment date: January 5th =&gt; commission is not settled for check</li>
<li>Settle commissions until payment date: January 15th =&gt; commission is settled for check</li>
</ul>
</dd>
</dl>
</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -399,7 +417,6 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<ol class="arabic simple">
<li>Create an invoice and using Checks to pay it.</li>
<li>Add a new checks deposit adding that payment.</li>
<li>Validate checks deposit.</li>
</ol>
<p>For settling the commissions to agents:</p>
<ol class="arabic simple">
Expand All @@ -411,11 +428,8 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<li>You can settle only certain agents if you select them on the “Agents”
section. Leave it empty for settling all.</li>
<li>Click on “Make settlements” button.</li>
<li><dl class="first docutils">
<dt>If safety days have passed from due date set in checks payment commission will be</dt>
<dd>settled properly.</dd>
</dl>
</li>
<li>If safety days have passed between settlement payment date and check due date,
commission will be settled properly.</li>
</ol>
</div>
<div class="section" id="bug-tracker">
Expand Down Expand Up @@ -443,10 +457,14 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">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>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/aleuffre"><img alt="aleuffre" src="https://github.com/aleuffre.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/renda-dev"><img alt="renda-dev" src="https://github.com/renda-dev.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/PicchiSeba"><img alt="PicchiSeba" src="https://github.com/PicchiSeba.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/commission/tree/14.0/sale_commission_check_deposit">OCA/commission</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
Expand Down
5 changes: 2 additions & 3 deletions sale_commission_check_deposit/wizard/wizard_check_settle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


import json
from datetime import date, timedelta
from datetime import timedelta

from odoo import models

Expand Down Expand Up @@ -31,13 +31,12 @@ def get_move_ids(self, payments_widget):
[
("move_id", "in", account_move_ids),
("journal_id.is_check_journal", "=", True),
("check_deposit_id", "!=", False),
]
)
return all(
[
x.date_maturity + timedelta(days=x.journal_id.safety_days)
< date.today()
< self.date_payment_to
for x in move_lines
]
)

0 comments on commit 37f9105

Please sign in to comment.