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

Hello,

I am wondering if there is any way I can create a field which will hold the content from my foods and combos models?

I want to give the user the possibility to either select a food or a combo from the same menu, and then wring up the nutritional data for whatever was selected, but I am stuck because I don't know how to populate a field with data from 2 separate models.

Any tip will be appreciated,

Thanks!

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

Hi,

add a field selection with values combo and foods

2 fields many2one with relation foods and combo

a field function that display the nutritial value

an onchange on field selection depending the 2 many2one fields with return False to the non selected many2one and become invisible.

bye

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 17
42846
1
thg 12 15
10024
1
thg 3 23
2217
0
thg 12 22
2858
0
thg 6 21
2862