Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
6483 Переглядів

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


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
січ. 25
6718
2
груд. 24
21169
0
вер. 24
1041
3
серп. 24
2153
computed fields Вирішено
1
квіт. 24
2689