Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1587 Lượt xem

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 :)

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 25
1017
2
thg 11 24
402
2
thg 9 23
5454
1
thg 3 23
4678
Editing Fields Đã xử lý
2
thg 11 20
3353