Skip to Content
Menu
This question has been flagged
2 Replies
5564 Views

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!


Avatar
Discard
Best Answer

 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.                                                                                                                       


 

Avatar
Discard
Author

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>

Best Answer
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="--"/>


Avatar
Discard
Related Posts Replies Views Activity
0
Sep 24
126
3
Aug 24
529
1
Apr 24
1473
0
Feb 24
265
0
Feb 24
159