跳至內容
選單
此問題已被標幟
2 回覆
1490 瀏覽次數

Hello everyone.

I'm looking to display a percentage of completion on a delivery note. This percentage should be [the sum of the quantities allocated to the delivery] / [the sum of the quantities requested].

To do this I've displayed my aggregated fields, but I can't manage to use them to complete my calculate field.


How can I do this?

Thanks in advance :)

頭像
捨棄
作者 最佳答案

Thanks Mehjabin Farsana,

I've displayed the aggregated fields by studio > modify the list view > select the quantity column > set the ‘aggregate’ field to ‘sum’.

How can I use them after this ? with developper mode no window is displayed on the aggregated field to find out its name and use it in my field calculation


頭像
捨棄
最佳答案

Hi,
If you've already displayed your aggregated fields but can't use them in your calculated field, it can be due to the fields are not stored properly

Computed fields in Odoo need to be stored in the database if you want to use them in another computed field. Make sure your aggregated fields are set with store=True.

Also make sure that you have added all the required dependencies using @api.depends decorator. If your calculated field depends on the aggregated fields, make sure they are listed in @api.depends.

To know more about this check this video also 


Hope this will help you

Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
2月 25
951
2
11月 24
402
2
9月 23
5263
1
3月 23
4533
2
11月 20
3268