Browse Source

[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.
pull/1/head
houssine 7 years ago
parent
commit
8938fb92c6
  1. 5
      easy_my_coop/models/coop.py

5
easy_my_coop/models/coop.py

@ -34,7 +34,10 @@ class subscription_request(models.Model):
else: else:
vals['type'] = 'subscription' vals['type'] = 'subscription'
vals['partner_id'] = cooperator.id vals['partner_id'] = cooperator.id
if not cooperator.cooperator:
cooperator.cooperator = True
subscr_request = super(subscription_request, self).create(vals) subscr_request = super(subscription_request, self).create(vals)
mail_template_obj = self.env['mail.template'] mail_template_obj = self.env['mail.template']
confirmation_mail_template = mail_template_obj.search([('name', '=', 'Confirmation Email')])[0] confirmation_mail_template = mail_template_obj.search([('name', '=', 'Confirmation Email')])[0]

Loading…
Cancel
Save