2013-04-07 54 views
-1

我想调整公司的模块采购申请。隐藏Openerp 7字段中的字段 - XML

为了实现这一点,我需要隐藏这个模块的一些元素。

在OpenERP的6,我知道你可以添加“位置=”替换”。

<field name="name" class="oe_inline" position="replace"/> 

在OpenERP的7本可以不再进行。

什么实际的方法上做到这一点OpenERP的7?

任何帮助将是非常赞赏,谢谢提前!


艾莉亚,谢谢你,但它并不掩饰领域

看看这个:

<group> 
     <field name="date_start" position="attributes"/> 
     <attribute name="invisible">True</attribute> 
     <field name="date_end" position="replace"/> 
     <field name="warehouse_id" widget="selection" groups="stock.group_locations"/> 
     <field name="company_id" groups="base.group_multi_company" widget="selection"/> 
</group> 

我需要例如躲在这里只是一个领域,使测试,但它实际上并没有隐藏它,它会在“date_end”之前显示一个“真”字。

回答

2

您的代码应该是这样

<group> 
     <field name="date_start" position="attributes"><!--removed/from the end--> 
     <attribute name="invisible">True</attribute> 
     </field> 
     <field name="date_end" position="replace"/> 
     <field name="warehouse_id" widget="selection" groups="stock.group_locations"/> 
     <field name="company_id" groups="base.group_multi_company" widget="selection"/> 
</group> 
+0

超级超级棒!非常感谢你!你摇滚! – NeoVe 2013-04-08 05:29:18

3

position="replace"仍在使用v7。

如果您不想替换该字段,您可以在字段中添加invisible="True"属性。

像这样:

<field name="name" position="attributes"> 
    <attribute name="invisible">True</attribute> 
</field> 

确保您继承了正确的XML。

+0

看我自己的答案,请:) – NeoVe 2013-04-07 19:28:02

+0

好了,解决了,只是删除了领域,非常感谢你! – NeoVe 2013-04-07 19:32:26

1

您关闭现场的标记之前更改属性

<group> 
     <field name="date_start" position="attributes"> 
      <attribute name="invisible">True</attribute> 
     </field> 
     <field name="date_end" position="replace"/> 
     <field name="warehouse_id" widget="selection" groups="stock.group_locations"/> 
     <field name="company_id" groups="base.group_multi_company" widget="selection"/> 
</group> 
+0

谢谢!非常好! – NeoVe 2013-05-09 19:32:10