[IMP] website_crm: Remove Contact Us configurations

Purpose
=======

It's configurable from the website editor itself.

Keep the default fields on the website model in case someone
changes its mind though.

closes odoo/odoo#82999

Related: odoo/upgrade#3210
Related: odoo/enterprise#23612
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Yannick Tivisse
2022-02-08 14:53:39 +00:00
parent 73483c8e5a
commit c7de4ff68c
4 changed files with 0 additions and 59 deletions
-1
View File
@@ -19,7 +19,6 @@ This module includes contact phone and mobile numbers validation.""",
'data/ir_actions_data.xml',
'data/ir_model_data.xml',
'views/crm_lead_views.xml',
'views/res_config_settings_views.xml',
'views/website_visitor_views.xml',
'views/website_templates_contactus.xml',
],
-1
View File
@@ -2,6 +2,5 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import crm_lead
from . import res_config_settings
from . import website
from . import website_visitor
@@ -1,20 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
def _get_crm_default_team_domain(self):
if not self.env.user.has_group('crm.group_use_lead'):
return [('use_opportunities', '=', True)]
return [('use_leads', '=', True)]
crm_default_team_id = fields.Many2one(
'crm.team', string='Default Sales Team', related='website_id.crm_default_team_id', readonly=False,
domain=lambda self: self._get_crm_default_team_domain(),
help='Default Sales Team for new leads created through the Contact Us form.')
crm_default_user_id = fields.Many2one(
'res.users', string='Default Salesperson', related='website_id.crm_default_user_id', domain=[('share', '=', False)], readonly=False,
help='Default salesperson for new leads created through the Contact Us form.')
@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.website.crm</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="website.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@data-key='website']" position="inside">
<h2>Communication</h2>
<div class="row mt16 o_settings_container" id="communication_settings">
<div class="col-12 col-lg-6 o_setting_box" id="contact_form_install_setting" title="New messages are managed as leads or opportunities in your CRM app.">
<div class="o_setting_right_pane">
<span class="o_form_label">Contact Form</span>
<div class="text-muted" id="msg_contact_form_install_setting">
Add a contact form in the <a href="/contactus">Contact Us</a> page
</div>
<div class="row">
<label class="col-lg-3 o_light_label" string="Sales Team" for="crm_default_team_id"/>
<field name="crm_default_team_id" class="oe_inline"/>
</div>
<div class="content-group mb16" attrs="{'invisible': [('crm_default_team_id', '!=', False)]}">
<div class="text-muted" id="msg_sale_team_setting">
Please set a Sales Team for the website. Otherwise you can't follow related events.
</div>
</div>
<div class="row">
<label class="col-lg-3 o_light_label" string="Salesperson" for="crm_default_user_id"/>
<field name="crm_default_user_id" class="oe_inline"/>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>