Tayyab Javed Tayyab Javed - 2 months ago 49
Python Question

How to remove/hide total sum in tree view in odoo?

I have odoo tree view in which there are some warehouse stock values displaying in columns. And its calculating total sum of these warehouse values in the bottom. I want to remove total sum in the bottom in tree view, how i can do that? you can see my tree view code i applied sum="false", total="false" but its not working. Anybody have idea that how it can be possible to remove total sum in tree view in odoo? I am also attaching image so you can easily understand my question. Thanks in advance...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>




Answer

If you just want to go to Settings/User Technical -> Interface -> Views you can edit the view like this. Just remove the sum tag entirely from the rows you wish not to be totalled.

<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"/>

Comments