Hello Everyone,
I have to try to implement to get default value in my one2many filed. In side one2many field "client_name" get default from sale order "partner_id". so how to do this.
I am try to set context :
<field name = "client_name" context = "{'default_customer':parent.partner_id}"/>
And call on my field
@api.multi
def _get_customer_name(self):
ctx = self.env.context
print "context::",ctx
client_name = filed.Many2one('res.partner' , default= _get_client_name)
and my output is :
context::: {'lang': u'en_US', 'tz': u'Asia/Kolkata', 'uid': 1}
and when i am try to apply context on my one2many field it's show Error:
Error: KeyError: 'partner_id'
So any suggestion.
Thanks for Help In Advanced.