[IMP] crm_livechat: add country from visitor to lead
Issue ----- Automatic assignation assign leads mostly based on country. So far the country need to be set manually on the lead. Solution -------- Since we have the information on the website vistor works, set the country on the lead from the visitor website. Unless the visitor is link to a partner with a country. In that case setting a country will cancel the address sync from the partner to the lead. closes odoo/odoo#59575 X-original-commit: eff2b357db179e6e62f3db58ca2d90cc61c3748f Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -15,4 +15,5 @@ class MailChannel(models.Model):
|
||||
visitor_sudo = self.livechat_visitor_id.sudo()
|
||||
if visitor_sudo:
|
||||
visitor_sudo.write({'lead_ids': [(4, lead.id)]})
|
||||
lead.country_id = lead.country_id or visitor_sudo.country_id
|
||||
return lead
|
||||
|
||||
Reference in New Issue
Block a user