Emi*_*td. 12
many2one小部件(默认)
选项:此小部件可以使用的其他可能选项.
例:
<field name="field_name" options="{'no_quick_create': True, 'no_create_edit' : True}"/>
Run Code Online (Sandbox Code Playgroud)
Many2many
小部件(默认)
选项
- no_create - remove the “Create” button.
Run Code Online (Sandbox Code Playgroud)
例
<field name="field_name" options="{'no_create': True}"/>
Run Code Online (Sandbox Code Playgroud)many2many_tags小部件
选项
no_quick_create - remove the Create and edit... option.
no_create_edit - remove the Create "search_value" option.
no_create - no_quick_create and no_create_edit together.
例
<field name="field_name" widget="many2many_tags" options="{'no_create_edit': True}"/>
Run Code Online (Sandbox Code Playgroud)要从搜索弹出窗口中删除CREATE按钮,需要将其从〜/ web/static/src/xml/base.xml文件中删除
有代码将此按钮添加到该搜索向导中.此按钮有条件地添加到向导但
no_create:True不能以某种方式工作.因此,如果您想从每个向导中删除它,那么只需将其从文件中删除,否则请考虑如何有条件地隐藏该字段.
<t t-name="SelectCreatePopup.search.buttons">
<t t-if="! widget.options.disable_multiple_selection">
<button type="button" class="oe_button oe_selectcreatepopup-search-select oe_highlight" disabled="disabled">Select</button>
</t>
<t t-if="!widget.options.no_create">
<button type="button" class="oe_button oe_selectcreatepopup-search-create">Create</button>
or </t><a class="oe_selectcreatepopup-search-close oe_bold oe_form_button_cancel" href="javascript:void(0)">Cancel</a>
</t>
Run Code Online (Sandbox Code Playgroud)