Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
6480 Ansichten

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
Verwerfen
Beste Antwort

 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
Verwerfen
Autor

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>

Beste Antwort
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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Jan. 25
6716
2
Dez. 24
21164
0
Sept. 24
1039
3
Aug. 24
2150
1
Apr. 24
2688