Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
21813 Vistas

Hello,

Is it possible to add a calculated measure to graph and pivot view?

For example in Sale Order Tree View i click on Group by --> Partner.
In the Pivot i see the measures "Amount Untaxed" and "Amount Total". In these two columns i see the two totals for each partner.
I want to add the Measure ("Amount Total" - "Amount Untaxed").

So, if with the partner "Agrolait" the sum of Amount Total is 100$ and the sum of Amount Untaxed is 80$ i want to see in the other column the value 20$

 i don't want to create a new field. In my example 100$ and 80$ are not the value of the field "Amount Total" and "Amount Untaxed" of one record but is the sum of the values of more records given by group_operator=sum ​

Thanks

Avatar
Descartar
Mejor respuesta

Hi!

Yes, it possible.

1- First, create the field with the computed value (don't forget to create the method _compute_amount_diff)

amount_diff = fields.Float("Amoun Diff.", compute='_compute_amount_diff', compute_sudo=True, store=True, digits=(12, 6), readonly=True)

2- Second, add the field in your XML view

<pivot string="Sales Orders">
<field name="amount_diff" type="measure"/>
</pivot>

Best regards!

Avatar
Descartar
Mejor respuesta

We have a module developed for this, please let me know if you need help in this regard.

Avatar
Descartar

Can you elaborate on this module? Can we test it somewhere?

Hi,

 

Using this module you can create any new formula field in any existing pivot table and add the view to favorites, we don’t have its demo anywhere setup but I can send you a small video if you want to.

 

We also have another module using that you can create new pivot table with drag and drop.

 


Thanks

Faisal Siddiqui

CTO

www.intelliVersal.com

Skype ID: intelliVersal

Cell/WhatsApp: +92 333 228 3797

 

From: Xavier Boes <notifications@mail.odoo.com>
Sent: Friday, May 20, 2022 2:32 PM
To: intelliVersal Integrated Solutions <faisal@intelliversal.com>
Subject: Re: Calculated Measure in Pivot and Graph View

 

Can you elaborate on this module? Can we test it somewhere?

Verzonden door Odoo S.A. gebruikende Odoo.

Autor Mejor respuesta

Hi!

Thanks for the answer but i don't want to create a field. In my example 100$ and 80$ are not the value of the field "Amount Total" and "Amount Untaxed" but is the sum of the values of more records given by group_operator=sum

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
oct 20
17070
2
jul 24
2122
2
may 24
1901
1
feb 24
1695
1
nov 22
5444