如何从many2one字段中删除"创建和编辑...".

Ann*_*ary 10 python xml one-to-many many-to-one openerp

请指教我如何从many2one字段中删除"创建和编辑...".该项目显示在我使用域选项过滤的many2one字段中.

OpenERP第7版

Sud*_*rya 18

我没有太多想法.也许是因为你必须在网络插件中进行更改.

但另一种解决方案是,您可以选择多个字段.在xml中添加属性.widget="selection"

<field name="Your_many2one_field" widget="selection">


Emi*_*td. 16

Many2one小部件(默认)

选项:此小部件可以使用的其他可能选项.

  • no_quick_create - 它将删除创建和编辑...选项.
  • no_create_edit - 它将删除创建"输入的文本"选项.
  • no_create - no_quick_create和no_create_edit组合在一起.
  • no_open - 处于读取模式:不渲染为链接.

示例:

<field name="field_name" options="{'no_quick_create': True, 'no_create_edit' : True}"/>
Run Code Online (Sandbox Code Playgroud)

你可以从Ludwik Trammer的帖子中找到它


shr*_*uti 6

它在openerp v7.0中进行了测试,我们可以通过下载存在的模块删除"创建和编辑",

https://www.odoo.com/apps/7.0/web_m2x_options/#access_token=31af017545174c1eb6745fa70c9b6684&scope=userinfo&state=&expires_in=3600&token_type=Bearer

并添加属性'create':false,'create_edit':false就像这样

    <field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false}"/>
Run Code Online (Sandbox Code Playgroud)

这里给出了一个很好的教程 https://www.odoo.com/apps/7.0/web_m2x_options/


Jus*_*ard 5

对于 Odoo 8.0 和 9.0,您应该使用 no_create 和 no_open。

no_create:设置为 True 可禁用在下拉列表中创建新条目的选项。

no_open:设置为 True 可禁用下拉列表右侧的按钮,该按钮会弹出一个窗口,允许编辑所选实例。

<field name="field_name"  options="{'no_create': True, 'no_open': True}" />
Run Code Online (Sandbox Code Playgroud)