[FIX] website_crm_partner_assign: Copy lead geolocation to created partner

Purpose
=======

The module website_crm_partner_assign has its own partner_longitude
and partner_latitude values that are resolved independently, when the
linked partner doesn't exist yet.

So when a lead is turned into an opportunity and a partner is created,
the address info is copied to the new partner, but not the geolocation.

In case these partners are supposed to be geolocalized (for example
on the FSM application), the geolocation will be recomputed despite
the fact that this information was already available at the convertion
time.

closes odoo/odoo#84890

Related: odoo/enterprise#24517
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Yannick Tivisse
2022-02-18 14:29:21 +00:00
parent dc3ad1381f
commit 6ea9f4845f
@@ -107,6 +107,14 @@ class CrmLead(models.Model):
})
return True
def _prepare_customer_values(self, partner_name, is_company=False, parent_id=False):
res = super()._prepare_customer_values(partner_name, is_company=is_company, parent_id=parent_id)
res.update({
'partner_latitude': self.partner_latitude,
'partner_longitude': self.partner_longitude,
})
return res
def search_geo_partner(self):
Partner = self.env['res.partner']
res_partner_ids = {}