i create a new object "hr.expense.reference" with relation to "hr.expense.line" and i wonts if the ref field change the analytic account field changes according to the data on the relational object in python
def onchange_reference_id(self, cr, uid, ids, ref, analytic_account, context=None):
res = {}
if ref:
reference = self.pool.get('hr.expense.reference').browse(cr, uid, name, analytic_account, context=context)
res['ref'] = reference.name
res['analytic_account'] = reference.analytic_account
return {'value': res}
in XML
<field name="ref" on_change="onchange_reference_id(ref,analytic_account,context)"/>
but i doesn't reflect any change somebody tell me how i can solve that plz