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

Need to remove create and edit option in partner field when the value of sale invoice type is credit. I found one similar answer in odoo forum but its not working

My code is:

<field name="partner_id" position="replace">

 <field name="partner_id" string="bhjk" domain="[('customer','=',True),('sale_invoice_type','=',sale_invoice_type)]"     context="{'search_default_customer':1, 'show_address': 1,'default_sale_invoice_type':sale_invoice_type}" attrs="  {'invisible': [('sale_invoice_type', '=', 'cash')]}" options='{"always_reload": True, "no_create_edit": True}'/>         

 <field name="partner_id" domain="[('customer','=',True),('sale_invoice_type','=',sale_invoice_type)]" context="{'search_default_customer':1, 'show_address': 1,'default_sale_invoice_type':sale_invoice_type}" attrs="{'invisible': [('sale_invoice_type', '=', 'credit')]}" options='{"always_reload": True}'/>

                    </field>

Аватар
Отменить
Лучший ответ

Hi

Try with following attributes.

options='{"always_reload": True, "no_create_edit": True, "no_create":True}'


if it's not working then the problem is two condition with single field will  not work.

Simple you can add one more field partner_id1 

onchange partner_id1  update partner_id field


<field name="partner_id" position="replace">

 <field name="partner_id" string="bhjk" domain="[('customer','=',True),('sale_invoice_type','=',sale_invoice_type)]"     context="{'search_default_customer':1, 'show_address': 1,'default_sale_invoice_type':sale_invoice_type}" attrs="  {'invisible': [('sale_invoice_type', '=', 'cash')]}" options='{"always_reload": True, "no_create_edit": True}'/>         

 <field name="partner_id1" domain="[('customer','=',True),('sale_invoice_type','=',sale_invoice_type)]" context="{'search_default_customer':1, 'show_address': 1,'default_sale_invoice_type':sale_invoice_type}" attrs="{'invisible': [('sale_invoice_type', '=', 'credit')]}" options='{"always_reload": True}'/>

                    </field>



Аватар
Отменить
Related Posts Ответы Просмотры Активность
9
июн. 23
12821
2
янв. 22
3689
2
дек. 21
7621
0
июн. 21
1801
0
февр. 21
2362