Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
8057 Visualizzazioni

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
Abbandona

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">

Autore

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

Risposta migliore

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
Abbandona
Autore

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?

Post correlati Risposte Visualizzazioni Attività
1
nov 24
815
5
lug 24
90603
1
dic 23
2423
1
mag 22
2782
1
set 21
8059