تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5 الردود
1191 أدوات العرض

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!

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
أفضل إجابة

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"/>
الصورة الرمزية
إهمال
أفضل إجابة

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>

الصورة الرمزية
إهمال
أفضل إجابة

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)

الصورة الرمزية
إهمال
الكاتب

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.

الكاتب أفضل إجابة

Anyone?

الصورة الرمزية
إهمال