跳至內容
選單
此問題已被標幟
1 回覆
4717 瀏覽次數

<record id="customer_ring_name" model="ir.ui.view">

<field name="name">customer.name.inherit.form</field>

<field name="model">sale.order</field>

<field name="inherit_id" ref="sale.view_order_form"/>

<field name="arch" type="xml">

<field name="boolvalue" invisible="1"/>


<t t-if="boolvalue == 'True'">

<xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='tax_id']" position="after" >

<!-- <field name="boolvalue" invisible="1"/> -->

<field name="string" />

</xpath>

</t>

</field>

</record>


頭像
捨棄
最佳答案

Hi,

Rather than trying to inherit based on condition, what you can do is that, inherit and add the field and give condition for the visibility, if the condition is not satisfied keep the field invisible and show only when condition satisfies.

Sample:


<field name='maximum_group' attrs="{'invisible': [('state', 'in', ('finished'))]}"/>


Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
4
3月 24
3348
1
10月 23
5322
1
6月 22
6554
4
6月 21
15827
2
8月 17
12625