Hi to all, does any one knows how to prepopulate a data on a one2many field? I mean, when a user clicks "Add an item" on a one2many fields some fields from this line will populated? I have here the image.
Any help is much appreciated.
You could use context to set the values of the fields at one2many field
In res.partner table, odoo uses context to pass the values of Company to its Contacts. Refer:https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_partner_view.xml#L191
(*) default_FIELDNAME ==> set value for your particular field
(*) search_default_FILTERNAME ==> sets the search filter by default
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
|Asked: 2/10/15, 5:45 AM|
|Seen: 786 times|
|Last updated: 3/16/15, 8:10 AM|