From 6c4cb32a874ac2ef3a5366aa2e5c1b5fac30093d Mon Sep 17 00:00:00 2001 From: houssine Date: Mon, 9 Jul 2018 14:46:49 +0200 Subject: [PATCH] [IMP] handle case where an old cooperator subscribe again for shares --- easy_my_coop/models/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/easy_my_coop/models/account_invoice.py b/easy_my_coop/models/account_invoice.py index 73f3ee4..e905a5d 100644 --- a/easy_my_coop/models/account_invoice.py +++ b/easy_my_coop/models/account_invoice.py @@ -28,6 +28,8 @@ class account_invoice(models.Model): sub_reg_num = sequence_id.next_by_id() self.partner_id.write({'member':True,'old_member':False, 'cooperator_register_number':int(sub_reg_num)}) + elif self.partner_id.old_member == False: + self.partner_id.write({'member':True,'old_member':False}) else: mail_template_name = 'Share Increase - Payment Received Confirmation - Send By Email' sequence_operation = obj_sequence.search([('name','=','Register Operation')])[0]