Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odpovědi
1081 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
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 Nejlepší odpověď

Anyone?

Avatar
Zrušit