I have partner_id field in my current form view and one button in which I pass context like this:-
<button type="object" name="create_repair" string="Create Repair" context="{'partner_id': partner_id}"/>
In create_repair method, I can get this context like this:-
def create_repair(self, context=None):
form_view = self.env.ref('mrp_repair.view_repair_order_form')
partner = context.get('partner_id')
return {
'name': 'Repair Order',
'view_type': 'form',
'view_mode': 'tree, form',
'res_model': 'mrp.repair',
'views': [
(form_view.id, 'form')
],
'type': 'ir.actions.act_window',
'context': {'partner_id': partner}
}
In my xml file, I can call like this:-
<field name="partner_id" context="{'partner_id': partner_id}"/>
But I cannot get any option selected.
I want to get value from one form and pass it on another form's field which is many2one field
Please help me to sort out this issue.
Context in Odoo: http://learnopenerp.blogspot.com/2018/01/get-parent-form-value-in-one2many-form.html