[FIX] crm_partner_assign: geolocalization was bad for large countries e.g. US or Russia
Add one more step considering a slightly larger range around the lead within the same country, before considering the whole country at once. Courtesy of Dhara Shah bzr revid: odo@openerp.com-20120309020415-f7jg21ud1lu2l61f
This commit is contained in:
parent
84e927120c
commit
4ecac7d5b4
|
@ -211,6 +211,14 @@ class crm_lead(osv.osv):
|
||||||
('country', '=', lead.country_id.id),
|
('country', '=', lead.country_id.id),
|
||||||
], context=context)
|
], context=context)
|
||||||
|
|
||||||
|
# 3. third way: in the same country, extra large area
|
||||||
|
if not partner_ids:
|
||||||
|
partner_ids = res_partner.search(cr, uid, [
|
||||||
|
('partner_weight','>', 0),
|
||||||
|
('partner_latitude','>', latitude - 8), ('partner_latitude','<', latitude + 8),
|
||||||
|
('partner_longitude','>', longitude - 8), ('partner_longitude','<', longitude + 8),
|
||||||
|
('country', '=', lead.country_id.id),
|
||||||
|
], context=context)
|
||||||
|
|
||||||
# 5. fifth way: anywhere in same country
|
# 5. fifth way: anywhere in same country
|
||||||
if not partner_ids:
|
if not partner_ids:
|
||||||
|
|
Loading…
Reference in New Issue