[IMP] crm_lead: message_new now uses the on_change_partner_id to set the address of the partner of the lead, if any.

bzr revid: tde@openerp.com-20130129143815-37voxmjw22eop7jl
This commit is contained in:
Thibault Delavallée 2013-01-29 15:38:15 +01:00
parent 22c857caf3
commit e9f6e0036e
1 changed files with 2 additions and 0 deletions

View File

@ -983,6 +983,8 @@ class crm_lead(base_stage, format_address, osv.osv):
'partner_id': msg.get('author_id', False),
'user_id': False,
}
if msg.get('author_id'):
defaults.update(self.on_change_partner(cr, uid, None, msg.get('author_id'), context=context)['value'])
if msg.get('priority') in dict(crm.AVAILABLE_PRIORITIES):
defaults['priority'] = msg.get('priority')
defaults.update(custom_values)