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

Fetch the customer while creating a new form

By
Mohammed Roshan
on 2/12/15, 4:31 AM 295 views

hi

In project.task we have created a new many2one field file_no.

when we create a new file no, using create and edit in file_no, a new form pops up

What i need is when we create a new file no, i wanna fetch the customer name (partner_id) that i have given in project.task form to the new form.

i have given a partner_id field in the new form too

thanks in advance

0

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3918
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 2/12/15, 4:46 AM

In XML,
<field name="field_no" context={'default_partner_id': partner_id} />

To pass a value available at your FORM to another pop-up, you need to pass the value through CONTEXT.
{'default_FIELDNAME': value @ FORM}  ==> Sets FIELDNAME with value @ FORM

For reference, you can check the Customer window, in which if you try to create a new company for a contact, the values are set using CONTEXT.

Thanks my friend it did work

Mohammed Roshan
on 2/12/15, 5:25 AM

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: 2/12/15, 4:31 AM
Seen: 295 times
Last updated: 3/16/15, 8:10 AM