从预定义模块继承表单视图 [英] Inherit form view from a predefined module

查看:108
本文介绍了从预定义模块继承表单视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建自己的模块,它是 sale.order 的扩展。我希望有一个表单视图,就像销售订单视图,其他几个字段,

我的问题是当我继承销售订单查看并添加三个额外字段,默认情况下这些字段在原始销售订单表单视图中。


这是默认行为还是我做错了什么?
我应该怎样做才能达到我的目的。

I want to create my own module which is an extension of sale.order. I want to have a form view which is like sale order view with few additional fields,
My problem is that when I inherit the sale order view and add say three extra fields these fields comes by default in the Original Sale Order form view too.
is this the default behaviour or am I doing something wrong ? What should I do to achieve what I want.

推荐答案

如果你继承视图并使用'添加一些字段' xpath',而不是通过安装新模块来更改原始视图。这是视图继承的应用。如果要在安装模块后保留原始表单视图,并希望定义另一个仅为自定义模块添加一些额外字段的视图,则必须创建不同的表单视图而不继承原始模块。可能在将来,将有一个扩展现有表单视图的工具,但是现在你不能这样做。

If you inherit the view and add some fields using 'xpath' , than it will change the original view by installing your new module. This is the application of view inheritance. If you want to keep the original form view as it is after the installation of your module and want to define another which have some extra fields only for your customized module, you have to make a different form view without inheriting the original one. May be in future , there will be a facility of extending an existing form view, but right now you can't do that.

这篇关于从预定义模块继承表单视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆