Odoo Help


This community 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.


On change function issue

eman ibrahim
on 4/11/14, 11:26 PM 434 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

Your Answer

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

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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