odoo-addon-account-commission 16.0.2.4.2.1__py3-none-any.whl → 16.0.2.5.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ .. image:: https://odoo-community.org/readme-banner-image
2
+ :target: https://odoo-community.org/get-involved?utm_source=readme
3
+ :alt: Odoo Community Association
4
+
1
5
  ===================
2
6
  Account commissions
3
7
  ===================
@@ -7,13 +11,13 @@ Account commissions
7
11
  !! This file is generated by oca-gen-addon-readme !!
8
12
  !! changes will be overwritten. !!
9
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:50991bf7ef618b918f0d0086baa3b337a6752514967915425fbbac2f07557231
14
+ !! source digest: sha256:c59d19febb630cbe46de5e379d652d5eb3237844ebc57ee4542555c81045a75e
11
15
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
16
 
13
17
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14
18
  :target: https://odoo-community.org/page/development-status
15
19
  :alt: Beta
16
- .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20
+ .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
17
21
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
22
  :alt: License: AGPL-3
19
23
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github
@@ -3,7 +3,7 @@
3
3
  # Copyright 2014-2022 Tecnativa - Pedro M. Baeza
4
4
  {
5
5
  "name": "Account commissions",
6
- "version": "16.0.2.4.2",
6
+ "version": "16.0.2.5.0",
7
7
  "author": "Tecnativa, Odoo Community Association (OCA)",
8
8
  "category": "Sales Management",
9
9
  "license": "AGPL-3",
@@ -23,6 +23,7 @@
23
23
  "views/report_settlement_templates.xml",
24
24
  "report/commission_analysis_view.xml",
25
25
  "wizards/wizard_invoice.xml",
26
+ "wizards/commission_make_settle_views.xml",
26
27
  ],
27
28
  "installable": True,
28
29
  }
@@ -210,6 +210,13 @@ msgstr ""
210
210
  msgid "Extended Filters"
211
211
  msgstr ""
212
212
 
213
+ #. module: account_commission
214
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
215
+ msgid ""
216
+ "For payment-based commissions, settlements will be created for payments"
217
+ " with date up to the one set in this field."
218
+ msgstr ""
219
+
213
220
  #. module: account_commission
214
221
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
215
222
  msgid "From Settlement"
@@ -390,6 +397,11 @@ msgstr ""
390
397
  msgid "Payment Based"
391
398
  msgstr ""
392
399
 
400
+ #. module: account_commission
401
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
402
+ msgid "Payment date up to"
403
+ msgstr ""
404
+
393
405
  #. module: account_commission
394
406
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
395
407
  msgid "Percentage of commission"
@@ -213,6 +213,13 @@ msgstr "Editar agentes"
213
213
  msgid "Extended Filters"
214
214
  msgstr "Filtros extendidos"
215
215
 
216
+ #. module: account_commission
217
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
218
+ msgid ""
219
+ "For payment-based commissions, settlements will be created for "
220
+ "payments with date up to the one set in this field."
221
+ msgstr ""
222
+
216
223
  #. module: account_commission
217
224
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
218
225
  msgid "From Settlement"
@@ -393,6 +400,11 @@ msgstr "Socio"
393
400
  msgid "Payment Based"
394
401
  msgstr "Basado en Pagos"
395
402
 
403
+ #. module: account_commission
404
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
405
+ msgid "Payment date up to"
406
+ msgstr ""
407
+
396
408
  #. module: account_commission
397
409
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
398
410
  msgid "Percentage of commission"
@@ -446,8 +458,8 @@ msgid ""
446
458
  "refunded)."
447
459
  msgstr ""
448
460
  "Seleccione el estado de la factura para liquidar las comisiones:\n"
449
- "* 'Basado en factura': Las comisiones se liquidan cuando se emite la factura."
450
- "\n"
461
+ "* 'Basado en factura': Las comisiones se liquidan cuando se emite la "
462
+ "factura.\n"
451
463
  "* 'Basado en Pago': Las comisiones se liquidan cuando se paga (o reembolsa) "
452
464
  "la factura."
453
465
 
@@ -214,6 +214,13 @@ msgstr "Modifier agents"
214
214
  msgid "Extended Filters"
215
215
  msgstr "Filtres avancés"
216
216
 
217
+ #. module: account_commission
218
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
219
+ msgid ""
220
+ "For payment-based commissions, settlements will be created for "
221
+ "payments with date up to the one set in this field."
222
+ msgstr ""
223
+
217
224
  #. module: account_commission
218
225
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
219
226
  msgid "From Settlement"
@@ -394,6 +401,11 @@ msgstr "Partenaire"
394
401
  msgid "Payment Based"
395
402
  msgstr "Basé sur payement"
396
403
 
404
+ #. module: account_commission
405
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
406
+ msgid "Payment date up to"
407
+ msgstr ""
408
+
397
409
  #. module: account_commission
398
410
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
399
411
  msgid "Percentage of commission"
@@ -443,7 +455,8 @@ msgstr "Factures de vente"
443
455
  msgid ""
444
456
  "Select the invoice status for settling the commissions:\n"
445
457
  "* 'Invoice Based': Commissions are settled when the invoice is issued.\n"
446
- "* 'Payment Based': Commissions are settled when the invoice is paid (or refunded)."
458
+ "* 'Payment Based': Commissions are settled when the invoice is paid (or "
459
+ "refunded)."
447
460
  msgstr ""
448
461
  "Selectionner le statut de la facture pour le règlement des commissions :\n"
449
462
  "*'Basé sur facture' : Les commissions sont réglées à l'émission de la "
@@ -521,8 +534,8 @@ msgstr "Sous-total"
521
534
  #. module: account_commission
522
535
  #: model:ir.model.fields,help:account_commission.field_commission_settlement__settlement_type
523
536
  msgid ""
524
- "The source of the settlement, e.g. 'Sales invoice', 'Sales order', 'Purchase"
525
- " order'..."
537
+ "The source of the settlement, e.g. 'Sales invoice', 'Sales order', 'Purchase "
538
+ "order'..."
526
539
  msgstr ""
527
540
  "La source du règlement, ex. 'Facture de vente', 'Bon de commande de vente', "
528
541
  "'Bon de commande d'achat' ..."
@@ -12,8 +12,8 @@ msgstr ""
12
12
  "MIME-Version: 1.0\n"
13
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
14
  "Content-Transfer-Encoding: \n"
15
- "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
16
- "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
15
+ "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
16
+ "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
17
17
 
18
18
  #. module: account_commission
19
19
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__quantity
@@ -212,6 +212,13 @@ msgstr ""
212
212
  msgid "Extended Filters"
213
213
  msgstr ""
214
214
 
215
+ #. module: account_commission
216
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
217
+ msgid ""
218
+ "For payment-based commissions, settlements will be created for "
219
+ "payments with date up to the one set in this field."
220
+ msgstr ""
221
+
215
222
  #. module: account_commission
216
223
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
217
224
  msgid "From Settlement"
@@ -392,6 +399,11 @@ msgstr ""
392
399
  msgid "Payment Based"
393
400
  msgstr ""
394
401
 
402
+ #. module: account_commission
403
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
404
+ msgid "Payment date up to"
405
+ msgstr ""
406
+
395
407
  #. module: account_commission
396
408
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
397
409
  msgid "Percentage of commission"
@@ -213,6 +213,13 @@ msgstr "Modifica agenti"
213
213
  msgid "Extended Filters"
214
214
  msgstr "Filtri estesi"
215
215
 
216
+ #. module: account_commission
217
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
218
+ msgid ""
219
+ "For payment-based commissions, settlements will be created for "
220
+ "payments with date up to the one set in this field."
221
+ msgstr ""
222
+
216
223
  #. module: account_commission
217
224
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
218
225
  msgid "From Settlement"
@@ -393,6 +400,11 @@ msgstr "Partner"
393
400
  msgid "Payment Based"
394
401
  msgstr "Basato su pagamenti"
395
402
 
403
+ #. module: account_commission
404
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
405
+ msgid "Payment date up to"
406
+ msgstr ""
407
+
396
408
  #. module: account_commission
397
409
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
398
410
  msgid "Percentage of commission"
@@ -213,6 +213,13 @@ msgstr ""
213
213
  msgid "Extended Filters"
214
214
  msgstr "拡張フィルタ"
215
215
 
216
+ #. module: account_commission
217
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
218
+ msgid ""
219
+ "For payment-based commissions, settlements will be created for "
220
+ "payments with date up to the one set in this field."
221
+ msgstr ""
222
+
216
223
  #. module: account_commission
217
224
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
218
225
  msgid "From Settlement"
@@ -393,6 +400,11 @@ msgstr "取引先"
393
400
  msgid "Payment Based"
394
401
  msgstr "支払基準"
395
402
 
403
+ #. module: account_commission
404
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
405
+ msgid "Payment date up to"
406
+ msgstr ""
407
+
396
408
  #. module: account_commission
397
409
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
398
410
  msgid "Percentage of commission"
@@ -213,6 +213,13 @@ msgstr "Editar agentes"
213
213
  msgid "Extended Filters"
214
214
  msgstr "Filtros Extendidos"
215
215
 
216
+ #. module: account_commission
217
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
218
+ msgid ""
219
+ "For payment-based commissions, settlements will be created for "
220
+ "payments with date up to the one set in this field."
221
+ msgstr ""
222
+
216
223
  #. module: account_commission
217
224
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
218
225
  msgid "From Settlement"
@@ -393,6 +400,11 @@ msgstr "Parceiro"
393
400
  msgid "Payment Based"
394
401
  msgstr "Com base no Pagamento"
395
402
 
403
+ #. module: account_commission
404
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
405
+ msgid "Payment date up to"
406
+ msgstr ""
407
+
396
408
  #. module: account_commission
397
409
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
398
410
  msgid "Percentage of commission"
@@ -214,6 +214,13 @@ msgstr "Editar Representantes"
214
214
  msgid "Extended Filters"
215
215
  msgstr "Filtros Extendidos"
216
216
 
217
+ #. module: account_commission
218
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
219
+ msgid ""
220
+ "For payment-based commissions, settlements will be created for "
221
+ "payments with date up to the one set in this field."
222
+ msgstr ""
223
+
217
224
  #. module: account_commission
218
225
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
219
226
  msgid "From Settlement"
@@ -394,6 +401,11 @@ msgstr "Parceiro"
394
401
  msgid "Payment Based"
395
402
  msgstr "Pagamento Relacionado"
396
403
 
404
+ #. module: account_commission
405
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
406
+ msgid "Payment date up to"
407
+ msgstr ""
408
+
397
409
  #. module: account_commission
398
410
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
399
411
  msgid "Percentage of commission"
@@ -213,6 +213,13 @@ msgstr "Temsilcileri düzenle"
213
213
  msgid "Extended Filters"
214
214
  msgstr "Genişletilmiş Filtreler"
215
215
 
216
+ #. module: account_commission
217
+ #: model:ir.model.fields,help:account_commission.field_commission_make_settle__date_payment_to
218
+ msgid ""
219
+ "For payment-based commissions, settlements will be created for "
220
+ "payments with date up to the one set in this field."
221
+ msgstr ""
222
+
216
223
  #. module: account_commission
217
224
  #: model:ir.model.fields,field_description:account_commission.field_commission_make_invoice__from_settlement
218
225
  msgid "From Settlement"
@@ -393,6 +400,11 @@ msgstr "İş Ortağı"
393
400
  msgid "Payment Based"
394
401
  msgstr "Ödeme Bazlı"
395
402
 
403
+ #. module: account_commission
404
+ #: model:ir.model.fields,field_description:account_commission.field_commission_make_settle__date_payment_to
405
+ msgid "Payment date up to"
406
+ msgstr ""
407
+
396
408
  #. module: account_commission
397
409
  #: model:ir.model.fields,field_description:account_commission.field_invoice_commission_analysis_report__percentage
398
410
  msgid "Percentage of commission"
@@ -442,7 +454,8 @@ msgstr "Satış Faturaları"
442
454
  msgid ""
443
455
  "Select the invoice status for settling the commissions:\n"
444
456
  "* 'Invoice Based': Commissions are settled when the invoice is issued.\n"
445
- "* 'Payment Based': Commissions are settled when the invoice is paid (or refunded)."
457
+ "* 'Payment Based': Commissions are settled when the invoice is paid (or "
458
+ "refunded)."
446
459
  msgstr ""
447
460
  "Komisyonların ödenmesi için fatura durumunu seçin:\n"
448
461
  "* 'Fatura Bazlı': Fatura düzenlendiğinde komisyonlar ödenir.\n"
@@ -518,8 +531,8 @@ msgstr "Aratoplam"
518
531
  #. module: account_commission
519
532
  #: model:ir.model.fields,help:account_commission.field_commission_settlement__settlement_type
520
533
  msgid ""
521
- "The source of the settlement, e.g. 'Sales invoice', 'Sales order', 'Purchase"
522
- " order'..."
534
+ "The source of the settlement, e.g. 'Sales invoice', 'Sales order', 'Purchase "
535
+ "order'..."
523
536
  msgstr ""
524
537
  "Anlaşmanın kaynağı, ör. 'Satış faturası', 'Satış siparişi', 'Alış "
525
538
  "siparişi'..."
@@ -251,7 +251,28 @@ class AccountInvoiceLineAgent(models.Model):
251
251
  :return: bool
252
252
  """
253
253
  self.ensure_one()
254
+ payment_based_commission = self.commission_id.invoice_state == "paid"
255
+ if payment_based_commission and self._skip_future_payments():
256
+ return True
254
257
  return (
255
- self.commission_id.invoice_state == "paid"
258
+ payment_based_commission
256
259
  and self.invoice_id.payment_state not in ["in_payment", "paid", "reversed"]
257
260
  ) or self.invoice_id.state != "posted"
261
+
262
+ def _skip_future_payments(self):
263
+ date_payment_to = self.env.context.get("date_payment_to")
264
+ if date_payment_to:
265
+ payments_dates = []
266
+ (
267
+ invoice_partials,
268
+ exchange_diff_moves,
269
+ ) = self.invoice_id._get_reconciled_invoices_partials()
270
+ for (
271
+ _partial,
272
+ _amount,
273
+ counterpart_line,
274
+ ) in invoice_partials:
275
+ payments_dates.append(counterpart_line.date)
276
+ if any(date_payment_to < date for date in payments_dates):
277
+ return True
278
+ return False
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
5
  <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
- <title>Account commissions</title>
6
+ <title>README.rst</title>
7
7
  <style type="text/css">
8
8
 
9
9
  /*
@@ -360,16 +360,21 @@ ul.auto-toc {
360
360
  </style>
361
361
  </head>
362
362
  <body>
363
- <div class="document" id="account-commissions">
364
- <h1 class="title">Account commissions</h1>
363
+ <div class="document">
365
364
 
365
+
366
+ <a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367
+ <img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368
+ </a>
369
+ <div class="section" id="account-commissions">
370
+ <h1>Account commissions</h1>
366
371
  <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
372
  !! This file is generated by oca-gen-addon-readme !!
368
373
  !! changes will be overwritten. !!
369
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:50991bf7ef618b918f0d0086baa3b337a6752514967915425fbbac2f07557231
375
+ !! source digest: sha256:c59d19febb630cbe46de5e379d652d5eb3237844ebc57ee4542555c81045a75e
371
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
- <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/16.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-16-0/commission-16-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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377
+ <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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/commission/tree/16.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-16-0/commission-16-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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
378
  <p>This module adds the function to calculate commissions in invoices (account moves).</p>
374
379
  <p>It also allows to create vendor bills from settlements for external agents.</p>
375
380
  <p>This module depends on the commission module.</p>
@@ -388,7 +393,7 @@ ul.auto-toc {
388
393
  </ul>
389
394
  </div>
390
395
  <div class="section" id="configuration">
391
- <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
396
+ <h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
392
397
  <p>For selecting invoice status in commissions:</p>
393
398
  <ol class="arabic simple">
394
399
  <li>Edit or create a new record to select the invoice status for settling the commissions.<ul>
@@ -401,7 +406,7 @@ be settled as well, resulting in a 0 net commission between both operations.</li
401
406
  </ol>
402
407
  </div>
403
408
  <div class="section" id="usage">
404
- <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
409
+ <h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
405
410
  <p>For adding commissions on invoices:</p>
406
411
  <ol class="arabic simple">
407
412
  <li>Go to <em>Invoicing &gt; Customers &gt; Invoices</em>.</li>
@@ -443,7 +448,7 @@ button.</li>
443
448
  </ol>
444
449
  </div>
445
450
  <div class="section" id="bug-tracker">
446
- <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
451
+ <h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
447
452
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/commission/issues">GitHub Issues</a>.
448
453
  In case of trouble, please check there if your issue has already been reported.
449
454
  If you spotted it first, help us to smash it by providing a detailed and welcomed
@@ -451,15 +456,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
451
456
  <p>Do not contact contributors directly about support or help with technical issues.</p>
452
457
  </div>
453
458
  <div class="section" id="credits">
454
- <h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
459
+ <h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
455
460
  <div class="section" id="authors">
456
- <h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
461
+ <h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
457
462
  <ul class="simple">
458
463
  <li>Tecnativa</li>
459
464
  </ul>
460
465
  </div>
461
466
  <div class="section" id="contributors">
462
- <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
467
+ <h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
463
468
  <ul class="simple">
464
469
  <li>Pexego.</li>
465
470
  <li>Davide Corio &lt;<a class="reference external" href="mailto:davide.corio&#64;domsense.com">davide.corio&#64;domsense.com</a>&gt;</li>
@@ -489,7 +494,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
489
494
  </ul>
490
495
  </div>
491
496
  <div class="section" id="maintainers">
492
- <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
497
+ <h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
493
498
  <p>This module is maintained by the OCA.</p>
494
499
  <a class="reference external image-reference" href="https://odoo-community.org">
495
500
  <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -504,5 +509,6 @@ promote its widespread use.</p>
504
509
  </div>
505
510
  </div>
506
511
  </div>
512
+ </div>
507
513
  </body>
508
514
  </html>
@@ -3,6 +3,8 @@
3
3
  # Copyright 2016-2022 Tecnativa - Pedro M. Baeza
4
4
  # License AGPL-3 - See https://www.gnu.org/licenses/agpl-3.0.html
5
5
 
6
+ from datetime import datetime
7
+
6
8
  from dateutil.relativedelta import relativedelta
7
9
 
8
10
  from odoo import fields
@@ -86,9 +88,12 @@ class TestAccountCommission(TestCommissionBase):
86
88
  vals.update({"currency_id": currency.id})
87
89
  return self.env["account.move"].create([vals])
88
90
 
89
- def _settle_agent_invoice(self, agent=None, period=None, date=None):
91
+ def _settle_agent_invoice(
92
+ self, agent=None, period=None, date=None, date_payment_to=None
93
+ ):
90
94
  vals = self._get_make_settle_vals(agent, period, date)
91
95
  vals["settlement_type"] = "sale_invoice"
96
+ vals["date_payment_to"] = date_payment_to
92
97
  wizard = self.make_settle_model.create(vals)
93
98
  wizard.action_settle()
94
99
 
@@ -660,7 +665,7 @@ class TestAccountCommission(TestCommissionBase):
660
665
  self.assertEqual(3, len(settlements.line_ids))
661
666
  self.assertAlmostEqual(0.6, sum(settlements.mapped("total")), 2)
662
667
 
663
- def _register_payment(self, invoice):
668
+ def _register_payment(self, invoice, date=None):
664
669
  payment_journal = self.env["account.journal"].search(
665
670
  [("type", "=", "cash"), ("company_id", "=", self.env.company.id)],
666
671
  limit=1,
@@ -668,7 +673,12 @@ class TestAccountCommission(TestCommissionBase):
668
673
  register_payments = (
669
674
  self.env["account.payment.register"]
670
675
  .with_context(active_ids=invoice.id, active_model="account.move")
671
- .create({"journal_id": payment_journal.id})
676
+ .create(
677
+ {
678
+ "journal_id": payment_journal.id,
679
+ "payment_date": date or datetime.now(),
680
+ }
681
+ )
672
682
  )
673
683
  register_payments.action_create_payments()
674
684
 
@@ -694,3 +704,23 @@ class TestAccountCommission(TestCommissionBase):
694
704
  self._settle_agent_invoice(self.agent_pending, 1)
695
705
  settlements = self.settle_model.search([("state", "=", "settled")])
696
706
  self.assertEqual(len(settlements.line_ids), 3)
707
+
708
+ def test_payment_date_settlement(self):
709
+ date = fields.Date.today()
710
+
711
+ invoice_after_cutoff = self._create_invoice(
712
+ self.agent_monthly, self.commission_net_paid
713
+ )
714
+ invoice_after_cutoff.invoice_line_ids.agent_ids._compute_amount()
715
+ invoice = self._create_invoice(self.agent_monthly, self.commission_net_paid)
716
+ invoice.invoice_line_ids.agent_ids._compute_amount()
717
+ (invoice_after_cutoff + invoice).action_post()
718
+
719
+ # Payment after the wizard payment date, not included in the settlement
720
+ self._register_payment(invoice_after_cutoff, date + relativedelta(days=2))
721
+ # Payment before the wizard payment date, not included in the settlement
722
+ self._register_payment(invoice, date - relativedelta(days=2))
723
+ self._settle_agent_invoice(self.agent_monthly, 1, date_payment_to=date)
724
+ settlements = self.settle_model.search([("state", "=", "settled")])
725
+ self.assertEqual(1, len(settlements))
726
+ self.assertEqual(1, len(settlements.line_ids))
@@ -13,6 +13,12 @@ class CommissionMakeSettle(models.TransientModel):
13
13
  selection_add=[("sale_invoice", "Sales Invoices")],
14
14
  ondelete={"sale_invoice": "cascade"},
15
15
  )
16
+ date_payment_to = fields.Date(
17
+ "Payment date up to",
18
+ help="For payment-based commissions, settlements will be created for payments \
19
+ with date up to the one set in this field.",
20
+ default=fields.Date.today,
21
+ )
16
22
 
17
23
  def _get_account_settle_domain(self, agent, date_to_agent):
18
24
  return [
@@ -46,3 +52,7 @@ class CommissionMakeSettle(models.TransientModel):
46
52
  }
47
53
  )
48
54
  return res
55
+
56
+ def action_settle(self):
57
+ self = self.with_context(date_payment_to=self.date_payment_to)
58
+ return super().action_settle()
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <odoo>
3
+ <record id="view_commission_make_settle_date_payment" model="ir.ui.view">
4
+ <field name="name">commission.make.settle.date.payment</field>
5
+ <field name="model">commission.make.settle</field>
6
+ <field name="inherit_id" ref="commission.view_settled_wizard" />
7
+ <field name="arch" type="xml">
8
+ <field name="date_to" position="after">
9
+ <field name="date_payment_to" />
10
+ </field>
11
+ </field>
12
+ </record>
13
+ </odoo>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-account_commission
3
- Version: 16.0.2.4.2.1
3
+ Version: 16.0.2.5.0.1
4
4
  Summary: Account commissions
5
5
  Home-page: https://github.com/OCA/commission
6
6
  Author: Tecnativa, Odoo Community Association (OCA)
@@ -14,6 +14,10 @@ Requires-Python: >=3.10
14
14
  Requires-Dist: odoo-addon-commission<16.1dev,>=16.0dev
15
15
  Requires-Dist: odoo<16.1dev,>=16.0a
16
16
 
17
+ .. image:: https://odoo-community.org/readme-banner-image
18
+ :target: https://odoo-community.org/get-involved?utm_source=readme
19
+ :alt: Odoo Community Association
20
+
17
21
  ===================
18
22
  Account commissions
19
23
  ===================
@@ -23,13 +27,13 @@ Account commissions
23
27
  !! This file is generated by oca-gen-addon-readme !!
24
28
  !! changes will be overwritten. !!
25
29
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
- !! source digest: sha256:50991bf7ef618b918f0d0086baa3b337a6752514967915425fbbac2f07557231
30
+ !! source digest: sha256:c59d19febb630cbe46de5e379d652d5eb3237844ebc57ee4542555c81045a75e
27
31
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28
32
 
29
33
  .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
30
34
  :target: https://odoo-community.org/page/development-status
31
35
  :alt: Beta
32
- .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
36
+ .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
33
37
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
34
38
  :alt: License: AGPL-3
35
39
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcommission-lightgray.png?logo=github
@@ -1,18 +1,18 @@
1
- odoo/addons/account_commission/README.rst,sha256=6pmSEYTQun7FeYzWZNGdJG1Nk-Z9aye1g0CKxH1cwaY,6161
1
+ odoo/addons/account_commission/README.rst,sha256=7CRlVmg-pS0mCf4klLv3P4Js6j7I8FNeT3b1QxoYvKg,6326
2
2
  odoo/addons/account_commission/__init__.py,sha256=8JG3SPnwMlgXTppOwkp3YTgDDQGo7U7veMEMpG1bL_c,64
3
- odoo/addons/account_commission/__manifest__.py,sha256=06daeydoCHPZIMO2G9Nj8_F9NFWWmoJA0_Iy7d-MZS8,893
3
+ odoo/addons/account_commission/__manifest__.py,sha256=KqPM9BBDCN7StMw2wXLQjDD__6Zx10kSbxIKlNdYmJw,945
4
4
  odoo/addons/account_commission/data/menuitem_data.xml,sha256=OX8KpilSn3zWf9cMNiJLDO7aV_vtaH6GTIyMZWDxYqM,361
5
- odoo/addons/account_commission/i18n/account_commission.pot,sha256=YM_lHjaDADe8EjFteiOtG5wRZutjZuvuXy8P7hCbZRU,21969
6
- odoo/addons/account_commission/i18n/es.po,sha256=LpIYITZRhwsIS9g0vHTFn2y9UQB42-LtKtD9ZKEWOJ8,25330
7
- odoo/addons/account_commission/i18n/fr.po,sha256=GjfNCbyouAIQ4InWglax2zcs3P17BALNJWmw-xbNkcA,24822
8
- odoo/addons/account_commission/i18n/hr.po,sha256=fotrWfKSA3Y7s8tge3UnkmwrlhM67nOOrigouGlauZA,22119
9
- odoo/addons/account_commission/i18n/it.po,sha256=P3sjkH9Zx7LpwhsutuAyPS3zwJXrP8EOpEumdFKfSjc,24749
10
- odoo/addons/account_commission/i18n/ja.po,sha256=YeK90kjfYXIq-Id4mPNrdcwt3MOLXt2iVGvVQhhXiR8,24668
11
- odoo/addons/account_commission/i18n/pt.po,sha256=83MR5lys6a8oRodMzS281ZWPj1bxg8Gvt6s-lRM3sek,24531
12
- odoo/addons/account_commission/i18n/pt_BR.po,sha256=r9XZOLIDWDr-iqm4tUoySIOGuPXXj2Ob0MVdMjjIpEs,24842
13
- odoo/addons/account_commission/i18n/tr.po,sha256=37k7M4oibBRneT4JTgiEEakIebFs7GFsVFlDdLhK1lk,24331
5
+ odoo/addons/account_commission/i18n/account_commission.pot,sha256=SnF-9UtFGizmgRYJa8tPqjE5bDeigee_ESc0E83bJdw,22422
6
+ odoo/addons/account_commission/i18n/es.po,sha256=kpHumZQByzaj0eNmQTz438eUvMBdLvy2Pmsk1-Csh4A,25783
7
+ odoo/addons/account_commission/i18n/fr.po,sha256=SRr5-F_X8q5JFcdwAyKHJ3qELEhXQuKwTT0YdPSeTO4,25278
8
+ odoo/addons/account_commission/i18n/hr.po,sha256=wK3zx_pQK_MdiMeMuf3pxz9ZURYjcd4U20lW9LRBy9Y,22572
9
+ odoo/addons/account_commission/i18n/it.po,sha256=9iwse2wMtJy7kN-rVw8ptm-Ho3-9Y3GkrwLzuxeD9vA,25202
10
+ odoo/addons/account_commission/i18n/ja.po,sha256=iUs8C4E75ekXSsV8osB-BAn3ieDL8K3qDe6KayMS6ls,25121
11
+ odoo/addons/account_commission/i18n/pt.po,sha256=I7Fm8AlHyDVZFYKxkYbUF--CY40xRPMwdnk-Fuxs1MI,24984
12
+ odoo/addons/account_commission/i18n/pt_BR.po,sha256=-aTJVpwiQazpaU6l25w_cozfV6P_w_qYxXUppbKl95s,25295
13
+ odoo/addons/account_commission/i18n/tr.po,sha256=9kHs3cenVzTjm-xpXN3R5iOwESHBKyUiUPt3dY_yvTQ,24787
14
14
  odoo/addons/account_commission/models/__init__.py,sha256=NAnZVtdmEwISK51Ipnoin5jHE3_bVPLsNghvuFcM3NI,88
15
- odoo/addons/account_commission/models/account_move.py,sha256=6P9SkOsurOvxTY4eA3hv72pHK95u1wYrkVYsLkSyJz4,9198
15
+ odoo/addons/account_commission/models/account_move.py,sha256=mueEa0ggihbON9o7KlOc3pcMYiJbyI8RK79dCSKA-Z4,9988
16
16
  odoo/addons/account_commission/models/commission.py,sha256=OHzmB5iH-h4oQf5JQGV4EFpNOkAHxC1_0-j0g-8nDXE,576
17
17
  odoo/addons/account_commission/models/commission_settlement.py,sha256=0E4xBJAUGyeAjDkhv4BwlpT4JigYDjOppfXuspynl4Q,7197
18
18
  odoo/addons/account_commission/readme/CONFIGURE.rst,sha256=vUEhtDTSXiZc88gXBuQZIcSkM3CbkmzQQwdVgJfnbSA,466
@@ -26,18 +26,19 @@ odoo/addons/account_commission/security/account_commission_security.xml,sha256=p
26
26
  odoo/addons/account_commission/security/ir.model.access.csv,sha256=c0k8cFhVg1A4XCaUQ-mzJdLIotKKt1ltIYznK8ELhYE,883
27
27
  odoo/addons/account_commission/static/description/icon.png,sha256=ydxSIUuHSeE4CfMVsEzLjKKVdX4RicuPj8VGM2rBpBg,8219
28
28
  odoo/addons/account_commission/static/description/icon.svg,sha256=96b_cQ-F1XuDU6S5mDi9ioe0d22Vwn30uBDQ_3ZSi5w,17220
29
- odoo/addons/account_commission/static/description/index.html,sha256=VpheuNYaSuRHhlJgcZpIFhx_GdBvIRjDwRJPW4-henM,17173
29
+ odoo/addons/account_commission/static/description/index.html,sha256=zcR4SFzAUITG_tgvp8sqHSNh2aSyC_qrZv3923tTdRQ,17391
30
30
  odoo/addons/account_commission/tests/__init__.py,sha256=bxd564RH-TWEpEJWbbc558dPFEJZCsH9JM8JF3-PMUM,38
31
- odoo/addons/account_commission/tests/test_account_commission.py,sha256=AMkGc0mPvdB9tIMBVec0w-zoE9pnapEteD8xFCJziOE,28724
31
+ odoo/addons/account_commission/tests/test_account_commission.py,sha256=sKAItw4ZUk8IC7pbqLU6y5f1oMgRAqoGhl924qozvcs,30029
32
32
  odoo/addons/account_commission/views/account_move_views.xml,sha256=N6PGXNMSxgpwaz5HtydDTRX0stu3QzTX5vBICCksP9s,6600
33
33
  odoo/addons/account_commission/views/commission_settlement_views.xml,sha256=JG5sX13R5jdB79m1Pub2rwqhM1s3Kux3btXAbgv_sFk,3496
34
34
  odoo/addons/account_commission/views/commission_views.xml,sha256=oY2-WJ-lEn3gCoFMqStKObGT3LRkBxMmANm2MRhYuRE,614
35
35
  odoo/addons/account_commission/views/report_settlement_templates.xml,sha256=ypyl80zXsb0QxjgV14QTP1hwSnLWs-_B_OzlzZs431w,1581
36
36
  odoo/addons/account_commission/wizards/__init__.py,sha256=ddwjnl0fpZTw56iNQmRcDJ0Q1RfptMC23XtvW93Ofec,66
37
- odoo/addons/account_commission/wizards/commission_make_settle.py,sha256=k7yztap0JSa5q-QH71GXd0WFaUG639ETaAKrqdH8UE0,1717
37
+ odoo/addons/account_commission/wizards/commission_make_settle.py,sha256=BTZIy9Z8Ic93okcYzBqvEV5uA71Qis3AzAnUv7thoJw,2108
38
+ odoo/addons/account_commission/wizards/commission_make_settle_views.xml,sha256=ONG4xseHOg3Ssy3ZBw-xgLDwPizulwNCWQfZGyuBFVE,528
38
39
  odoo/addons/account_commission/wizards/wizard_invoice.py,sha256=SumDW3606uLS4d6L2rKjQbwdvfmIYovKark-EUMTve0,3162
39
40
  odoo/addons/account_commission/wizards/wizard_invoice.xml,sha256=Afx90Mccl0EjLzZ2dJa2dOikYhWxIY5tQ7objmca8gc,2292
40
- odoo_addon_account_commission-16.0.2.4.2.1.dist-info/METADATA,sha256=JVXmCC_es906lYZLjiT9ClsUQmekcFznbSQX1Pddv2s,6727
41
- odoo_addon_account_commission-16.0.2.4.2.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
42
- odoo_addon_account_commission-16.0.2.4.2.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
43
- odoo_addon_account_commission-16.0.2.4.2.1.dist-info/RECORD,,
41
+ odoo_addon_account_commission-16.0.2.5.0.1.dist-info/METADATA,sha256=H62r0hkkI9Omo38kxCczqBnqfO0t_WwW_74VOBnsbYw,6892
42
+ odoo_addon_account_commission-16.0.2.5.0.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
43
+ odoo_addon_account_commission-16.0.2.5.0.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
44
+ odoo_addon_account_commission-16.0.2.5.0.1.dist-info/RECORD,,