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

I would like to "mute" the qty field on pos.order form for predetermined products starting with (or containing) the char '#'.

<field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"  attrs="{'invisible':[('product_id',whathere?,'#')]}"/> 

What should be the correct syntax for attrs? Is there any problem using this parameter with on_change? 

アバター
破棄
最善の回答

Hi,

you need to define your field as like below.

<field name="qty" on_change="onchange_qty(product_id, discount, qty, price_unit, context)"
attrs="{'invisible':[('product_id.name','ilike','#')]}" />

When product name is containing "#" at that time "qty" field will be invisible.

アバター
破棄
著作者

No. It doesn't work with 'product_id.name': Uncaught Error: Unknown field product_id.name in domain [["product_id.name","ilike","#"]]. Please note the -1 is not mine. :)

関連投稿 返信 ビュー 活動
2
5月 15
6065
1
6月 23
1936
1
7月 19
4510
1
6月 16
4703
0
6月 16
3890