Ir al contenido
Menú
Se marcó esta pregunta
5 Respuestas
1061 Vistas

I am trying to remove the "lead generation" section underneath "settings" => "CRM"

I am receiving the following error when trying:

Element '<xpath expr="//block[@name=&#39;convert_visitor_setting_container&#39;]">' cannot be located in parent view


I am using the following code to try to remove the section:

<?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.crm</field>

        <field name="model">res.config.settings</field>

        <field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>

        <field name="arch" type="xml">

            <xpath expr="//block[@name='convert_visitor_setting_container']" position="replace">


            </xpath>

        </field>

    </record>

</odoo>


can someone please help me out? Thanks in advance!

Avatar
Descartar
Mejor respuesta

Hi

The error message raise because  Odoo is referencing the General Settings view (general_settings) instead of the CRM settings view, which is incorrect .

To resolve this issue, ensure that your custom module explicitly depends on the CRM module by including it in your module's __manifest__.py file.


Please try the following code to remove the section:


<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <record id="res_config_settings_view_form_inherit" model="ir.ui.view">

        <field name="name">res.config.settings.view.form.inherit.crm.remove.lead</field>

        <field name="model">res.config.settings</field>

        <field name="inherit_id" ref="crm.res_config_settings_view_form"/>

        <field name="arch" type="xml">

            <xpath expr="//block[@name='convert_visitor_setting_container']" position="replace">

            </xpath>

        </field>

    </record>

</odoo>



Regards,

Jishna

Accurates

Avatar
Descartar
Mejor respuesta

Hi, 

If your question is still to hide "lead generation" part, then most of the solutions above should work for you. 

You need to inherit to this external id: crm.res_config_settings_view_form

with this xpath, and that's it:

<xpath expr="//block[@name='convert_visitor_setting_container']" position="replace"/>
Avatar
Descartar
Mejor respuesta

Try this:

<odoo>

​<record id="res_config_settings_view_form_inherit_custom" model="ir.ui.view">

​<field name="name">res.config.settings.view.form.inherit.custom</field>

​<field name="model">res.config.settings</field>

​<field name="inherit_id" ref="base.res_config_settings_view_form"/>

​<field name="arch" type="xml">

​<xpath expr="//block[@name='convert_visitor_setting_container']" position="replace">

​</xpath>

​</field>

​</record>

</odoo>

Avatar
Descartar
Mejor respuesta

Hi,

you can try below example to replace that section/block.

<record model="ir.ui.view" id="res_config_settings_view_form">
<field name="name">res.config.settings.view.form</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="crm.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//app[@name='crm']/block[@name='convert_visitor_setting_container']" position="replace">
</xpath>
</field>
</record>

Thanks & Regards,
Sunny Sheth (shethsunny555@gmail.com)

Avatar
Descartar
Autor

Hi Sunny,
I am receiving the following error with that code:

Error while validating view near:

<app data-string="General Settings" string="General Settings" name="general_settings" logo="/base/static/description/settings.png">

<div id="invite_users">
<block title="Users" name="users_setting_container">
<setting id="invite_users_setting">

Field "group_use_recurring_revenues" does not exist in model "res.config.settings"

Any clue whats wrong? Thank you for your time!
Kind regards!

Hi,

might be you can add priorities in that view so that could not get issue if related.

Autor Mejor respuesta

Anyone?

Avatar
Descartar