Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
6503 Представления

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
6724
2
дек. 24
21178
0
сент. 24
1047
3
авг. 24
2160
computed fields Решено
1
апр. 24
2694