This question has been flagged
2 Replies
6976 Views

Hello,

I'm inheriting analytic_account_views and commenting out a single field which shouldn't be displayed according to my need but what happens here is the view won't change no matter what i change in the inherited view. No errors are thrown and in the UI too my inherited view code gets displayed but the view or the fields that i changed won't change or won't reflect in the view. Can anyone tell why or what's happening?

P.S: Version is 12

<record model="ir.ui.view" id="TestAnalyticAccountCreateForm">
<field
name="name">analytic.analytic.account.form.inherit.test</field>
<field
name="model">account.analytic.account</field>
<field
name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field
name="arch" type="xml">
<xpath
expr="/form/sheet/group[@name='main']" position="replace">
<group
name="main">
<group>
<field
name="code"/>
<!--<field
name="partner_id"/>-->
</group>
<group>
<field
name="group_id"/>
<field
name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field
name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
</group>
</group>
</xpath>
</field>
</record>

Avatar
Discard

please check that the xml file you registered into the manifest.py file and another is make sure yourself that into xml file you don't use <data noupdate="1">

Author

I made sure of it and there are no noupdate tags present in the xml file

Best Answer

Hi,

Try this code,

<record model="ir.ui.view" id="view_account_analytic_account_form_inherit">
<field name="name">analytic.analytic.account.form.inherit.test</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="replace">
</field>
</field>
</record>

Before,



After,



Thanks

Avatar
Discard
Author

What if i want to insert a new field into that existing group? Also how did you achieve that? I mean without using xpath tag how did the view change?? Can you please tell me what's going on?