From 7b9cbb41457a2d39a066b8e6e07163d5c6e6f68f Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Tue, 23 Oct 2018 18:22:04 +0200 Subject: [PATCH] [FIX]GOLEM Activity Registration Payment : unique invoice this season And not default season only --- golem_activity_registration_payment/__manifest__.py | 2 +- .../wizard/golem_activity_registration_invoicing.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/golem_activity_registration_payment/__manifest__.py b/golem_activity_registration_payment/__manifest__.py index 2363982..cfb8e4a 100644 --- a/golem_activity_registration_payment/__manifest__.py +++ b/golem_activity_registration_payment/__manifest__.py @@ -20,7 +20,7 @@ 'name': 'GOLEM Activity Member Registration Payments', 'summary': 'GOLEM Activities Member Registration Payments', 'description': 'GOLEM Activities Member Registration Payments', - 'version': '10.0.0.4.1', + 'version': '10.0.0.5.0', 'category': 'GOLEM', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py index 5145c6c..96fd434 100644 --- a/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py +++ b/golem_activity_registration_payment/wizard/golem_activity_registration_invoicing.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Copyright 2017-2018 Fabien Bourgeois +# Copyright 2018 Youssef El Ouahby # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -86,8 +87,8 @@ class GolemActivityRegistrationInvoicing(models.TransientModel): partner = self.member_id.partner_id #check if there is a draft invoice for the current customer member_line = partner.member_lines.filtered( - lambda ml: (ml.membership_id.membership_season_id.is_default and - ml.account_invoice_id.state == 'draft') + lambda ml: (ml.membership_id.membership_season_id == self.season_id + and ml.account_invoice_id.state == 'draft') ) if member_line: invoice = member_line[0].account_invoice_id