This question has been flagged
1 Reply
1880 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

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

Thanks my friend it did work