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

how to access another models fields from view (xml) file

By
Merlin TecSol Pvt. Ltd.
on 5/9/13, 5:31 AM 2,760 views

I have a need wherein I need to access values that are in another model (table) from a view which is tied to a different model (table).

For example I have a model called metals.metals and another model called chemical.properties.

Now when a view tied to chemical.properties is loaded based on some condition I need to access value of a field (column) that is in metals.metals as using domain attribute in field.

I have been trying to do this for two days now but without any success.

Please guide me as to how to achieve this.

TIA

I forgot to mention that chemical.properties view will opened from metal.metal view and when this view is opened I need to read the currently loaded values in metal.metal view which I think we should be able to read values that are currently load in the view using for example something like this metal.metal.id. But this is not working. :(

0

Vasiliy Birukov

--Vasiliy Birukov--
3446
| 6 6 8
Russian Federation
--Vasiliy Birukov--

Help develop and implement any project on base Odoo.

Vasiliy Birukov
On 5/9/13, 6:14 AM

Add to chemical.properties related field that point to field from metals.metals. After it you can use new field in XML form.

0

saad

--saad--
1008
| 5 4 8
Casablanca, Morocco
--saad--
saad
On 5/9/13, 6:30 AM

I think you should define a related field in chemical.properties model to refer to metals.metals field.

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

0 follower(s)

Stats

Asked: 5/9/13, 5:31 AM
Seen: 2760 times
Last updated: 3/16/15, 8:10 AM