Browse Source

[FIX] handle the case where the subscription is created from the CRM

pull/1/head
houssine 6 years ago
parent
commit
a93f97ba3e
  1. 7
      easy_my_coop/models/coop.py

7
easy_my_coop/models/coop.py

@ -40,7 +40,12 @@ class subscription_request(models.Model):
if not cooperator.cooperator:
cooperator.write({'cooperator':True})
else:
cooperator_id = vals.get('partner_id')
cooperator = self.env['res.partner'].browse(cooperator_id)
if cooperator.member:
vals['type'] = 'increase'
vals['already_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]

Loading…
Cancel
Save