コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
21844 ビュー

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

アバター
破棄
最善の回答

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!

アバター
破棄
最善の回答

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

アバター
破棄

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.

著作者 最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
10月 20
17102
2
7月 24
2222
2
5月 24
2095
1
2月 24
1757
1
11月 22
5522