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

Hello!

I'm currently using xmlrpc nodejs library to communicate externally with my odoo DB. 

While retrieving products, I see we only retrieve the direct category (categ_id). I'd like to know if somehow it's possible to retrieve the categories tree with the product at the same time we retrieve the products. Meaning the product category and its all parents. I'd gain in performance.


Maybe I've to create a calculated field but I'm quite new on there so I don't really know how to perform that. Any help will be so appreciated! 


Thanks ;)

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

Hello Haisnain,

Happy new year!

It does not work, when I try to pass a field parameter as list it complains : 
TypeError: unhashable type: 'list'

Any idea ? 

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


You can Check this to retrieve the complete category tree for a product in Odoo 14 using the product.template model's read method and the ['categ_id', 'categ_id.complete_name'] fields.

Let me know if you Need any further Assistance

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 24
1498
0
thg 9 24
824
1
thg 1 24
4924
1
thg 5 23
2531
0
thg 1 23
1941