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

I'm trying to create a pivot view of pricelists, which gives a clear report on every pricelists and their items. But as some of the fields in the 'product.pricelist.item' model is computed fields and not stored I cannot access them in pivot view. Can anybody give me an idea how to achieve this ?

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi Kiran, I don't have enough points to add a comment to your answer so I'm writing my reply here. I had tried by adding the attribute 'store=True', but this makes all the existing data to be empty and once i edit and save them again the value is returned.

Câu trả lời hay nhất

Hi , 

Computed fields which are not stored in database cannot be used in Pivot Views

add the attribute  store=True  

price_subtotal = fields.Monetary(string='Amount',
store=True, readonly=True, compute='_compute_subtotal')

Hope it Helps,
Kiran K

Ảnh đại diện
Huỷ bỏ

good- working

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 23
1405
1
thg 2 21
3679
1
thg 7 25
1596
2
thg 1 20
4953
4
thg 5 18
17440