Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _lead_create_contact(self, cr, uid, lead, name, is_company, parent_id=False, context=None):
- partner = self.pool.get('res.partner')
- vals = {'name': name,
- 'user_id': lead.user_id.id,
- 'comment': lead.description,
- 'section_id': lead.section_id.id or False,
- 'parent_id': parent_id,
- 'phone': lead.phone,
- 'mobile': lead.mobile,
- #'email': tools.email_split(lead.email_from) and tools.email_split(lead.email_from)[0] or False,
- 'email': 'hello world',
- 'fax': lead.fax,
- 'title': lead.title and lead.title.id or False,
- 'function': lead.function,
- 'street': lead.street,
- 'street2': lead.street2,
- 'zip': lead.zip,
- 'city': lead.city,
- 'country_id': lead.country_id and lead.country_id.id or False,
- 'state_id': lead.state_id and lead.state_id.id or False,
- 'is_company': is_company,
- # add custom fields mapping
- 'x_havesap': lead.x_hassap,
- 'x_branch': lead.x_branch,
- 'x_countperson': lead.x_countperson,
- 'x_turnover': lead.x_turnover,
- # add custom fields mapping
- 'type': 'contact'
- }
- partner = partner.create(cr, uid, vals, context=context)
- return partner
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement