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

set a default value in one form based on the value in another form.

By
emonrockz
on 7/7/14, 5:49 AM 455 views

Hi,

I have two classes (say class.a, class.b). 

In class.a form, I have two fields (say field1, field2). field1 is a char, field2 is a many2one relation with class.b.

In class.b is having two fields (say fb1, fb2 both are char). 

 

While selecting a value for field2 in class.a, if I click on create & Edit in the drop down, class.b form will appear. But I want fb2 field to be autofilled with field1 value in class.a.

 

Please help me with a solution.

Thanks in Advance.

 

Regards,

Emon

1

René Schuster

--René Schuster--
1560
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 7/7/14, 5:55 AM

In your view for class a, add a context to the many2one field.

<field name="class_b_id" context="{'default_fb2': field1}"/>

 

Regards.

0
emonrockz
On 7/7/14, 6:22 AM

Thank You René Schuster  it worked.

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: 7/7/14, 5:49 AM
Seen: 455 times
Last updated: 3/16/15, 8:10 AM