一般互联网人群

odoo8-addon-web-m2x-options的Python项目详细描述


License: AGPL-3

为many21字段添加新选项

此模块修改“many21”和“many2manytags”窗体小部件,以便添加一些新的显示 控制选项。

提供的选项包括删除“创建…”和/或“创建和 从many2one下拉列表中编辑…“条目。您还可以更改 出现在下拉列表中的建议。或阻止对话框弹出 验证错误的情况。

如果未指定,模块将避免提出任何创建选项 如果当前用户没有创建相关对象的权限。

使用量

Try me on Runbot

有关详细信息,请访问:

在字段的选项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

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:真

红外型号选项

现在可以在目标模型的模型基础上禁用快速全局创建。

disable_quick_createboolean(默认值:False

Whether to disable quick create for this model globally. This has the same effect as if you would add ^{tt23}$ to all m2x fields in all fields with that target model in their relation.

示例

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调试器应该暂停。如果不验证您的安装。

此模块修复了搜索弹出窗口中限制项目数量的odoo错误。 至160 https://github.com/odoo/odoo/commit/8c3cdce539d87775b59b3f2d5ceb433f995821bf 为此,它以前会发出一个简单的search调用,以获取所有id。 这个过程可能会使弹出窗口的显示变慢,以防出现大型数据库。

路线图

  • 我认为最好将文本作为一个可点击的链接,而不是使标记矩形可点击,这样我们将获得与其他可点击元素(many2one…)一致的行为/方面。
  • 在编辑模式下,最好添加一个类似于many2one字段的图标,以便在弹出窗口中打开many2many。
  • 通过参数将此功能作为一个可配置的选项包括在内,以便在所有many2many标记中默认具有此行为。
  • 模型上“禁用快速创建”标志查询的客户端缓存。

缺陷跟踪器

GitHub Issues上跟踪错误。 如果出现问题,请检查是否已报告您的问题。 如果您首先发现了它,请提供详细且受欢迎的反馈,帮助我们粉碎它 here

学分

贡献者

维护人员

Odoo Community Association

此模块由OCA维护。

oca,或odoo社区协会,是一个非营利性组织 任务是支持odoo特性和 促进其广泛应用。

若要对此模块作出贡献,请访问http://odoo-community.org

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用prepared语句在oracle中插入日期   对点具有双重值的java   使用多个通配符的java请求映射   java Springboot为什么要设置springbootstartertomcat   除了对JavaBean的请求之外,还使用servletContext的servlet   java如何清除OCSID。返回到池的连接时的CLIENTID JDBC客户端信息属性   将整型数组转换为光栅Java   java使用对象引用作为互斥锁   java为什么在编程语言中使用sin函数返回奇怪的sin值不像计算器   java如何将JButton链接到对象并调用相关方法   php用Java发送POST数据   导航属性的java模拟加载   java多个活动错误Android试图对空对象引用调用虚拟方法“”   java Android更改ActionBar文本颜色   如何使用带有java反射且不带开关的parant引用创建子类