Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Is it possible to populate a One2Many field with content from 2 different models?

By
Yakito
on 3/15/15, 9:31 PM 752 views

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!

2

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 3/16/15, 2:13 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/15/15, 9:31 PM
Seen: 752 times
Last updated: 3/18/15, 10:23 PM