[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
|
return res
|
||||||
|
|
||||||
def assign_geo_localize(self, cr, uid, ids, latitude=False, longitude=False, context=None):
|
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
|
# Don't pass context to browse()! We need country name in english below
|
||||||
for lead in self.browse(cr, uid, ids):
|
for lead in self.browse(cr, uid, ids):
|
||||||
if not lead.country_id:
|
if not lead.country_id:
|
||||||
|
@ -177,14 +183,11 @@ class crm_lead(osv.osv):
|
||||||
city=lead.city,
|
city=lead.city,
|
||||||
state=lead.state_id.name,
|
state=lead.state_id.name,
|
||||||
country=lead.country_id.name))
|
country=lead.country_id.name))
|
||||||
if not latitude and result:
|
if result:
|
||||||
latitude = result[0]
|
self.write(cr, uid, [lead.id], {
|
||||||
if not longitude and result:
|
'partner_latitude': result[0],
|
||||||
longitude = result[1]
|
'partner_longitude': result[1]
|
||||||
self.write(cr, uid, [lead.id], {
|
}, context=context)
|
||||||
'partner_latitude': latitude,
|
|
||||||
'partner_longitude': longitude
|
|
||||||
}, context=context)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def search_geo_partner(self, cr, uid, ids, context=None):
|
def search_geo_partner(self, cr, uid, ids, context=None):
|
||||||
|
|
Loading…
Reference in New Issue