From 8938fb92c634205aa70114b76358791e6f78aaf7 Mon Sep 17 00:00:00 2001 From: houssine Date: Mon, 15 Jan 2018 11:56:54 +0100 Subject: [PATCH] [FIX] in the case where a partner is already in the database(e.g as a company partner) we flag the cooperator field to True at the subscription request creation. --- easy_my_coop/models/coop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/easy_my_coop/models/coop.py b/easy_my_coop/models/coop.py index b4ba187..68ca2ce 100644 --- a/easy_my_coop/models/coop.py +++ b/easy_my_coop/models/coop.py @@ -34,7 +34,10 @@ class subscription_request(models.Model): else: vals['type'] = 'subscription' vals['partner_id'] = cooperator.id - + + if not cooperator.cooperator: + cooperator.cooperator = True + subscr_request = super(subscription_request, self).create(vals) mail_template_obj = self.env['mail.template'] confirmation_mail_template = mail_template_obj.search([('name', '=', 'Confirmation Email')])[0]