* = bus, calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot,
mass_mailing, privacy_lookup, test_discuss_full, test_mail,
test_mail_full, website_crm_livechat, website_livechat, base
In preparation of splitting discuss and mail modules.
Part of task-3265211
closes odoo/odoo#118354
Related: odoo/upgrade#4553
Related: odoo/enterprise#39661
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
21 lines
803 B
Python
21 lines
803 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
|
|
|
|
class ChatbotScriptStep(models.Model):
|
|
_inherit = 'chatbot.script.step'
|
|
|
|
def _chatbot_prepare_customer_values(self, discuss_channel, create_partner=True, update_partner=True):
|
|
values = super()._chatbot_prepare_customer_values(discuss_channel, create_partner, update_partner)
|
|
visitor_id = discuss_channel.livechat_visitor_id
|
|
if visitor_id:
|
|
if not values.get('email') and visitor_id.email:
|
|
values['email'] = visitor_id.email
|
|
if not values.get('phone') and visitor_id.mobile:
|
|
values['phone'] = visitor_id.mobile
|
|
values['country_id'] = visitor_id.country_id
|
|
|
|
return values
|