跳至内容
菜单
此问题已终结
1 回复
3431 查看

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>



形象
丢弃
相关帖文 回复 查看 活动
9
6月 23
12830
2
1月 22
3696
2
12月 21
7630
0
6月 21
1805
0
2月 21
2373