1

我正在尝试从 openERP 的默认新产品页面继承和添加/删除一些字段。我想更改搜索产品视图中默认“创建”按钮的行为,以将用户发送到修改的产品页面,但我似乎无法更改它。我已经尝试过 XPath、position="replace" 和其他一些东西,但似乎没有任何效果。我该如何抓住它?只需使用 XPath 并将其替换为另一个按钮?

如何更改单击该按钮的结果?

谢谢,

4

4 回答 4

1

我认为您正在尝试删除树视图中显示的创建按钮。要删除它,有一个名为 .openerp 的 openerp 模块web-remove-quick-create。它在openerp 应用程序中。请使用这个。否则尝试修改 jc 和 css 文件。谢谢

于 2012-11-16T06:02:36.090 回答
0

As I understand you want to modify product form view and remove some of the unnecessary fields for your application.

you just need to create inherited views for the fields you need to remove from the form view. for 6.1 to remove the weight field in product form view

  1. activate the developer mode by clicking information button next to the exit button on top right and click to the activate developer mode text.
  2. open the product form you would like to modify
  3. select manage views from developer drop down menu
  4. click edit
  5. select the field you would like to remove
  6. click on inherited view button to create an inherited view and confirm the dialogue go to views from settings > Customization > User interface > views
  7. find the inherited view you just created by writing name or object and checking the few results.
  8. the inherited view is like

<?xml version='1.0'?>
<field name='weight' position='after'> </field>

- to remove the weight field just change the position property with replace

<?xml version='1.0'?>
<field name='weight' position='replace'> </field>

save the inherited view, its done. you can also achieve this by just adding invisible to the filed property like

<?xml version='1.0'?>
<field name='weight' position='replace'><field name='weight' invisible='1'?></field>

if there are more than one inherited views referring to the same field you may need to increase or decrease the sequence value of the inherited view to change the order of inherited view to get the necessary behavior.

于 2013-01-20T12:47:20.860 回答
0

您没有描述您想要实现的目标,但可能的解决方案可能是:

  • 授予您的用户对 Product 模型的只读访问权限,让他们
  • 通过向导创建新产品,通过客户端操作打开。
于 2012-11-16T13:46:39.780 回答
0

杰夫,

您不能通过 uisng XPath, position="replace" 删除创建按钮。创建按钮是从视图模板的一部分,您可以在 web 插件部分 formview js 文件中找到它。和 qweb xml 模板,您可以使用一些硬代码对其进行 Web 修改,但这会影响所有视图,因为创建按钮是所有视图的通用/通用模板。所以即使你尝试 CSS 和 JS 的东西我也不建议。

谢谢你,

于 2012-11-16T09:46:40.970 回答