在具有属性widget =“ selection”

时间:2018-07-27 09:50:18

标签: python xml odoo

我已经创建了一些用户组,这些用户组在创建采购订单时不应创建新产品。因此,作为解决方案,我将product_id设置为many2one字段,并在xml端添加了widget =“ selection”。 我现在有一个选择字段,无法创建新产品(很好),但是问题是我无法搜索或过滤这些产品。 有任何想法吗? (我想要这个弹出窗口: enter image description here

1 个答案:

答案 0 :(得分:0)

我找到了解决方案: 当我使用widget =“ selection”时,我无法搜索更多产品,因为该字段成为了选择字段。 相反,我使用

 <field name="product_id"   options="{'no_quick_create': True, 'no_create_edit' : 
True}" /> 

现在,我具有“搜索更多”选项,如下图所示: enter image description here