Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8985 มุมมอง

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>

อวตาร
ละทิ้ง

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

ผู้เขียน

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

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

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?

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 24
2020
Change the Position of field in Xpath แก้ไขแล้ว
5
ก.ค. 24
94138
1
ธ.ค. 23
3366
1
พ.ค. 22
4184
Fields from another model แก้ไขแล้ว
1
ก.ย. 21
9064