如何在odoo中删除/隐藏树视图中的总和?

时间:2016-09-08 18:53:24

标签: python xml openerp views odoo-8

我有odoo树视图,其中有一些仓库库存值显示在列中。并计算底部仓库价值的总和。我想在树视图中删除底部的总和,我该怎么做?你可以看到我的树视图代码我应用sum =“false”,total =“false”但它不起作用。任何人都知道如何在odoo中删除树视图中的总和?我也附上图片,这样你就可以轻松理解我的问题了。提前致谢... enter image description here

<tree string="Warehouse Product" editable="bottom" create="false" edit="false" delete="false" sum="false">
       <field name="warehouse_id"/>
       <field name="qty" sum="Quantity"/>
       <field name="incoming_qty" sum="Incoming"/>
       <field name="outgoing_qty" sum="Total Confirmed"/>
       <field name="reserved_event" sum="Events"/>
       <field name="reserved_sale" sum="Total Reserved"/>
       <field name="backorder_qty" sum="Backordes"/>
       <field name="actual_qty" sum="Actual Qty"/>
       <field name="warehouse_inventory" sum="Total Warehouse Qty"/>
</tree>

完成后,我只是从每个字段中删除sum =“”并删除总和的底线,这是我的更新代码

<tree string="Warehouse Product" editable="bottom" create="false" edit="false" delete="false">
  <field name="warehouse_id"/>
  <field name="qty"/>
  <field name="incoming_qty"/>
  <field name="outgoing_qty"/>
  <field name="reserved_event"/>
  <field name="reserved_sale"/>
  <field name="backorder_qty"/>
  <field name="actual_qty"/>
  <field name="warehouse_inventory"/>
</tree>

3 个答案:

答案 0 :(得分:3)

如果您只想转到设置/用户技术 - &gt;界面 - &gt;视图可以像这样编辑视图。只需从您希望不总计的行中完全删除sum标记。

<tree string="Warehouse Product" editable="bottom" create="false" edit="false" delete="false">
   <field name="warehouse_id"/>
   <field name="qty" sum="Quantity"/>
   <field name="incoming_qty"/>
   <field name="outgoing_qty"/>
   <field name="reserved_event"/>
   <field name="reserved_sale"/>
   <field name="backorder_qty"/>
   <field name="actual_qty"/>
   <field name="warehouse_inventory"/>

答案 1 :(得分:1)

只需删除sum属性

<tree string="Warehouse Product" editable="bottom" create="false" edit="false" delete="false">
       <field name="warehouse_id"/>
       <field name="qty" />
       <field name="incoming_qty" />
       <field name="outgoing_qty" />
       <field name="reserved_event" />
       <field name="reserved_sale" />
       <field name="backorder_qty" />
       <field name="actual_qty" />
       <field name="warehouse_inventory" />
</tree>

答案 2 :(得分:0)

已完成,我刚从每个字段中删除了sum="",并删除了总和的底线,这是我的更新代码:

&#13;
&#13;
<tree string="Warehouse Product" editable="bottom" create="false" edit="false" delete="false">
      <field name="warehouse_id"/>
      <field name="qty"/>
      <field name="incoming_qty"/>
      <field name="outgoing_qty"/>
      <field name="reserved_event"/>
      <field name="reserved_sale"/>
      <field name="backorder_qty"/>
      <field name="actual_qty"/>
      <field name="warehouse_inventory"/>
</tree>
&#13;
&#13;
&#13;