[FIX]crm_partner_assign: assign_geo_localize function was assigning the latitude/longitude of the first lead to all other leads passed
bzr revid: dle@openerp.com-20131031160215-qkm1fujob53umg3x
This commit is contained in:
parent
959b0bc720
commit
9fca9bbbd6
|
@ -168,6 +168,12 @@ class crm_lead(osv.osv):
|
|||
return res
|
||||
|
||||
def assign_geo_localize(self, cr, uid, ids, latitude=False, longitude=False, context=None):
|
||||
if latitude and longitude:
|
||||
self.write(cr, uid, ids, {
|
||||
'partner_latitude': latitude,
|
||||
'partner_longitude': longitude
|
||||
}, context=context)
|
||||
return True
|
||||
# Don't pass context to browse()! We need country name in english below
|
||||
for lead in self.browse(cr, uid, ids):
|
||||
if not lead.country_id:
|
||||
|
@ -177,14 +183,11 @@ class crm_lead(osv.osv):
|
|||
city=lead.city,
|
||||
state=lead.state_id.name,
|
||||
country=lead.country_id.name))
|
||||
if not latitude and result:
|
||||
latitude = result[0]
|
||||
if not longitude and result:
|
||||
longitude = result[1]
|
||||
self.write(cr, uid, [lead.id], {
|
||||
'partner_latitude': latitude,
|
||||
'partner_longitude': longitude
|
||||
}, context=context)
|
||||
if result:
|
||||
self.write(cr, uid, [lead.id], {
|
||||
'partner_latitude': result[0],
|
||||
'partner_longitude': result[1]
|
||||
}, context=context)
|
||||
return True
|
||||
|
||||
def search_geo_partner(self, cr, uid, ids, context=None):
|
||||
|
|
Loading…
Reference in New Issue