コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
1838 ビュー

I need to disable price_unit if standard_price != 0 or profit_rate !=0.

My view:



model="ir.ui.view" id="sale_order_view_inherit">
name="name">sale.order.view.inherit1
name="model">sale.order
name="inherit_id" ref="sale.view_order_form"/>
name="arch" type="xml">
expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='name']" position="after">
name="standard_price"/>
name="profit_rate" widget="percentage"/>

expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="replace">
name="price_unit" attrs="{'readonly': ['|', ('qty_invoiced', '>', 0), ('profit_rate', '!=', 0), ('standard_price', '!=', 0)]}"/>






But price_unit is disabled only when both standard_price != 0 and profit_rate !=0. Please help!

アバター
破棄
最善の回答

Hi,

You have missed one OR operator, update the code as follows:

attrs="{'readonly': ['|', '|', ('qty_invoiced', '>', 0), ('profit_rate', '!=', 0), ('standard_price', '!=', 0)]}"


Thanks

アバター
破棄