From 1b2f3d7eb805d09bcb82d99babf389b702848a1c Mon Sep 17 00:00:00 2001 From: houssine Date: Wed, 24 Jan 2018 15:44:10 +0100 Subject: [PATCH] [FIX] if an old cooperator subscribe again to some share, he should not receive a new cooperator number --- easy_my_coop/models/account_invoice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easy_my_coop/models/account_invoice.py b/easy_my_coop/models/account_invoice.py index 9e56fae..4093849 100644 --- a/easy_my_coop/models/account_invoice.py +++ b/easy_my_coop/models/account_invoice.py @@ -23,10 +23,10 @@ class account_invoice(models.Model): mail_template_name = 'Payment Received Confirmation - Send By Email' # if not yet cooperator we generate a cooperator number - if self.partner_id.member == False : + if self.partner_id.member == False and self.partner_id.old_number == False: sequence_id = obj_sequence.search([('name','=','Subscription Register')])[0] sub_reg_num = sequence_id.next_by_id() - self.partner_id.write({'member':True, + self.partner_id.write({'member':True,'old_member':False, 'cooperator_register_number':int(sub_reg_num)}) else: mail_template_name = 'Share Increase - Payment Received Confirmation - Send By Email'