Browse Source

[FIX] set the res partner name in company_name when partner is a company

pull/1/head
houssine 7 years ago
parent
commit
232b432068
  1. 3
      easy_my_coop/wizard/create_subscription_from_partner.py

3
easy_my_coop/wizard/create_subscription_from_partner.py

@ -76,16 +76,17 @@ class PartnerCreateSubscription(models.TransientModel):
sub_req = self.env['subscription.request'] sub_req = self.env['subscription.request']
cooperator = self.cooperator cooperator = self.cooperator
vals = {'partner_id': cooperator.id, vals = {'partner_id': cooperator.id,
'name': cooperator.name,
'share_product_id':self.share_product.id, 'share_product_id':self.share_product.id,
'ordered_parts':self.share_qty, 'ordered_parts':self.share_qty,
'user_id':self.env.uid, 'user_id':self.env.uid,
'source':'crm'} 'source':'crm'}
if self.is_company: if self.is_company:
vals['company_name'] = self.cooperator.name
vals['company_register_number'] = self.register_number vals['company_register_number'] = self.register_number
vals['is_company'] = True vals['is_company'] = True
else: else:
vals['name'] = self.cooperator.name
vals['no_registre'] = self.register_number vals['no_registre'] = self.register_number
if not self._get_register_number(): if not self._get_register_number():

Loading…
Cancel
Save