Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
6 ตอบกลับ
14781 มุมมอง

Hello all!

I'm on odoo 8.

Do you have a trick to remove the total column at the right of the pivot table (see image below).

Do I have to make some javascript for this? I hope not...


XML

<record id="view_account_invoice_report_period_graph_vtm2" model="ir.ui.view">
 <field name="name">account.invoice.report.period.graph.vtm2</field>
 <field name="model">account.invoice.report.vtm2</field>
 <field name="arch" type="xml">
     <graph string="Invoices Analysis" type="pivot">
         <field name="fiscal_position" type="row"/>
         <field name="period_id" type="col"/>
         <field name="price_total" type="measure"/>
     </graph>
 </field>
 </record>


Image


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just un mark it from Measures.

อวตาร
ละทิ้ง
ผู้เขียน

The measure is for each column. Not just the total column at the right. If I uncheck it, there is no more columns.

Hai Pascal Tremblay,

You must have to select any of the measures from the list.Otherwise its shows nothing.

That means, Uncheck the Total column first.then select another measure that you want.

Then click the (-)Total in the top.

ผู้เขียน

Thanks for this answer. I would like to display the pivot table directly without the total column. Without click. I thought that we could make it in XML... It seems that it is not possible.

Ohh...is that your need??

you can done this by the help of xml.

use this code.

<?xml version="1.0" encoding="UTF-8" ?>

<openerp>

<data>

<record id="measure_test_sales" model="ir.ui.view">

<field name="name">measure_test_sales.view</field>

<field name="model">sale.report</field>

<field name="inherit_id" ref="sale.view_order_product_pivot"/>

<field name="arch" type="xml">

<xpath expr="//field[@name='price_subtotal']" position="replace">

<field name="price_subtotal" />

</xpath>

</field>

</record>

</data>

</openerp>

คำตอบที่ดีที่สุด

find data relation in your python file and set store value false. 


For example:

pivot_percentage = fields.Float("Percentage", compute="_pivot_percentage_compute", store=False)

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
hide a table in a pdf report แก้ไขแล้ว
1
ธ.ค. 22
3677
Hide fields from pivot view แก้ไขแล้ว
1
ก.ค. 21
3999
2
ก.พ. 17
6227
1
เม.ย. 24
3643
2
ก.ย. 24
2030