19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:53 +01:00
parent dc68f80d3f
commit 7221b9ac46
610 changed files with 135477 additions and 161677 deletions

View file

@ -1,45 +1,32 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import Command
from odoo.addons.im_livechat.tests.chatbot_common import ChatbotCase
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.addons.mail.tests.common import MailCommon
class CrmChatbotCase(ChatbotCase):
class CrmChatbotCase(MailCommon, ChatbotCase):
@classmethod
def setUpClass(cls):
super(CrmChatbotCase, cls).setUpClass()
cls.company_id = cls.env['res.company'].create({
'name': 'Test Company',
'country_id': cls.env.ref('base.be').id,
})
cls.user_public = mail_new_test_user(
cls.env, login='user_public', groups='base.group_public', name='Public User')
cls.user_portal = mail_new_test_user(
cls.env, login='user_portal', groups='base.group_portal', name='Portal User',
company_id=cls.company_id.id, email='portal@example.com')
# update company_id on partner since the user's company is not propagated
cls.user_portal.partner_id.write({'company_id': cls.company_id.id})
cls.sale_team = cls.env['crm.team'].create({
'name': 'Test Sale Team 1',
'company_id': cls.company_id.id,
})
cls.sale_team_with_lead = cls.env['crm.team'].create({
'name': 'Test Sale Team 2',
'use_leads': True,
'company_id': cls.company_id.id,
})
super().setUpClass()
cls._create_portal_user()
teams_data = [
{
"company_id": cls.company_admin.id,
"crm_team_member_ids": [Command.create({"user_id": cls.user_employee.id})],
"name": "Test Sale Team 1",
},
{
"company_id": cls.company_admin.id,
"name": "Test Sale Team 2",
"use_leads": True,
},
]
cls.sale_team, cls.sale_team_with_lead = cls.env["crm.team"].create(teams_data)
cls.step_dispatch_create_lead = cls.env['chatbot.script.answer'].sudo().create({
'name': 'Create a lead',
'script_step_id': cls.step_dispatch.id,
})
[
cls.step_create_lead_email,
cls.step_create_lead_phone,