From b9b197370d82cca85f562a07c679cd6e973a565b Mon Sep 17 00:00:00 2001 From: "matteo.tognini" Date: Tue, 29 Aug 2023 08:51:07 +0200 Subject: [PATCH] [IMP]change manifest, add condition on payments widget --- sale_commission_settlement_payment_date/__manifest__.py | 2 +- .../readme/DESCRIPTION.rst | 4 +++- .../wizard/wizard_settle.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sale_commission_settlement_payment_date/__manifest__.py b/sale_commission_settlement_payment_date/__manifest__.py index 5925ccefd..253d725c1 100644 --- a/sale_commission_settlement_payment_date/__manifest__.py +++ b/sale_commission_settlement_payment_date/__manifest__.py @@ -2,7 +2,7 @@ "name": "Commission Settlement base on payment date", "summary": "commission/sale_quick_commission", "version": "14.0.1.0.0", - "author": "Nextev," "Odoo Community Association (OCA)", + "author": "Nextev," "Ooops404," "Odoo Community Association (OCA)", "category": "Sales Management", "license": "AGPL-3", "depends": [ diff --git a/sale_commission_settlement_payment_date/readme/DESCRIPTION.rst b/sale_commission_settlement_payment_date/readme/DESCRIPTION.rst index 91715f356..3649ec9ed 100644 --- a/sale_commission_settlement_payment_date/readme/DESCRIPTION.rst +++ b/sale_commission_settlement_payment_date/readme/DESCRIPTION.rst @@ -1 +1,3 @@ -This module allows to add the invoice payment date until you want to settle commissions +This module allows to settle commissions up to a specified payment date. +This only applies to commission types with "invoice status = payment based". + diff --git a/sale_commission_settlement_payment_date/wizard/wizard_settle.py b/sale_commission_settlement_payment_date/wizard/wizard_settle.py index 21d87dca2..1992503e0 100644 --- a/sale_commission_settlement_payment_date/wizard/wizard_settle.py +++ b/sale_commission_settlement_payment_date/wizard/wizard_settle.py @@ -20,7 +20,7 @@ def _get_agent_lines(self, agent, date_to_agent): lambda r: r.commission_id.invoice_state == "paid" and self.date_payment_to != "false" ): - if not self.check_payment_date(line): + if line.invoice_id.invoice_payments_widget != 'false' and not self.check_payment_date(line): agent_lines -= line return agent_lines