一般互联网人群
odoo10-addon-web-m2x-options的Python项目详细描述
为many21字段添加新选项
说明
此模块修改“many21”和“many2manytags”窗体小部件,以便添加一些新的显示 控制选项。
提供的选项包括删除“创建…”和/或“创建和 从many2one下拉列表中编辑…“条目。您还可以更改 出现在下拉列表中的建议。或阻止对话框弹出 验证错误的情况。
如果未指定,模块将避免提出任何创建选项 如果当前用户没有创建相关对象的权限。
在字段选项中dict
createboolean(默认值:取决于用户是否具有创建权限)
Whether to display the “Create…” entry in dropdown panel.
create_editboolean(默认值:取决于用户是否具有创建权限)
Whether to display “Create and Edit…” entry in dropdown panel
m2o_dialogboolean(默认值:取决于用户是否具有创建权限)
Whether to display the many2one dialog in case of validation error.
limitint(默认:openerp默认值为7)
Number of displayed record in drop-down panel
search_more布尔型
Used to force disable/enable search more button.
field_color字符串
A string to define the field used to define color. This option has to be used with colors.
colors字典
A dictionary to link field value with a HTML color. This option has to be used with field_color.
no_open_editboolean(默认值:如果未设置no_open的值,则为False)
Causes a many2one not to offer to click through in edit mode, but well in read mode
openboolean(默认值:False)
Makes many2many_tags buttons that open the linked resource
no_color_pickerboolean(默认值:False)
Deactivates the color picker on many2many_tags buttons to do nothing (ignored if open is set)
ir.config_参数选项
现在您可以为odoo实例中的所有小部件禁用“create…”和“create and edit…”条目。 如果禁用一个选项,则可以通过直接在字段定义上设置“create:true”选项来为特定字段启用该选项。
web_m2x_options.createboolean(默认值:取决于用户是否具有创建权限)
Whether to display the “Create…” entry in dropdown panel for all fields in the odoo instance.
web_m2x_options.create_editboolean(默认值:取决于用户是否具有创建权限)
Whether to display “Create and Edit…” entry in dropdown panel for all fields in the odoo instance.
web_m2x_options.m2o_dialogboolean(默认值:取决于用户是否具有创建权限)
Whether to display the many2one dialog in case of validation error for all fields in the odoo instance.
web_m2x_options.limitint(默认:openerp默认值为7)
Number of displayed record in drop-down panel for all fields in the odoo instance
web_m2x_options.search_moreboolean(默认:默认值为False)
Whether the field should always show “Search more…” entry or not.
要添加这些参数,请转到“配置”->;“技术”->;“参数”->;“系统参数”,然后添加新参数,如:
- web_m2x_options.create:false
- web_m2x_options.create_edit:false
- web_m2x_options.m2o_对话框:false
- WEB_m2x_选项。限制:10
- web_m2x_options.search_more:真
示例
XML表单视图定义可以包含:
... <field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false, 'search_more':true 'field_color':'state', 'colors':{'active':'green'}}"/> ...
已知问题
仔细检查您是否没有继承的视图来删除您在字段上设置的options! 如果不起作用,请在get_search_result method的第一行中添加调试器,并在odoo中启用调试模式。当您在many21字段中编写某些内容时,javascript调试器应该暂停。如果不验证您的安装。
路线图
- 我认为最好将文本作为一个可点击的链接,而不是使标记矩形可点击,这样我们将获得与其他可点击元素(many2one…)一致的行为/方面。
- 在编辑模式下,最好添加一个类似于many2one字段的图标,以便在弹出窗口中打开many2many。
- 通过参数将此功能作为一个可配置的选项包括在内,以便在所有many2many标记中默认具有此行为。
错误跟踪器
错误在GitHub Issues上跟踪。 如果出现问题,请检查是否已报告您的问题。 如果您首先发现了它,请提供详细且受欢迎的反馈,帮助我们粉碎它 here。
学分
贡献者
- 大卫Conickx<;davconinckx@gmail.com>;
- 伊曼纽尔·西诺ecino@compassion.ch>;
- 霍尔格·布鲁恩hbrunn@therp.nl>;
- 尼古拉斯·杰迪,nicolas@sudokeys.com>;
- 扬尼克·沃彻(Yannick Vaucher)yannick.vaucher@camptocamp.com>;
- 扎卡莉亚·马克雷鲁夫z.makrelouf@gmail.com>;
- 杰罗·洛皮斯,jairo.llopis@tecnativa.com>;
- 大卫·维达尔david.vidal@tecnativa.com>;