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

Hi,

I am working on Sales module, create new Sale Order Line in Sale Order form.

I would like to display "--" instead of blank text in Taxes column when user selected nothing.

I tried this code but it did not work.

<field
name="tax_id"
widget="many2many_tags"
options="{'no_create': True}"
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)], 'placeholder': '--'}"
/>

How can I do that? Thank you!


アバター
破棄
最善の回答

 HI,

 Here is wrong :

     attrs="{'readonly': [('qty_invoiced', '&gt;', 0)], 'placeholder': '--'}"

 You can use  placeholder outside in attrs. 

 For Example:

<field
name="tax_id"
placeholder="Your Text"
widget="many2many_tags"
options="{'no_create': True}"
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '>', 0)]}"> 

make sure it will helpful.

Thank you.                                                                                                                       


 

アバター
破棄
著作者

Thank you for your answer!

I used this code to solve it

<xpath expr="//field[@name='order_line']/tree/field[@name='tax_id']" position="attributes">

<attribute name="placeholder">--</attribute>

</xpath>

最善の回答
You can use this code. But this place holder text will not go from even if you select taxes into 
tax_id field.
<field
name="tax_id"
widget="many2many_tags"
options="{'no_create': True}"
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}" placeholder="--"/>


アバター
破棄
関連投稿 返信 ビュー 活動
2
1月 25
6717
2
12月 24
21169
0
9月 24
1041
3
8月 24
2153
1
4月 24
2689