Odoo Help

0

On change function issue

By
eman ibrahim
on 4/11/14, 11:26 PM 531 views

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

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 4/11/14, 11:26 PM
Seen: 531 times
Last updated: 3/16/15, 8:10 AM