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.


How to use the onchange function in openerp

on 11/12/14, 4:25 AM 746 views

HI anyone please help me how to use onchange function in openerp urgent 

This is not a real question. Elaborate more on what you tried, what went wrong, etc. Otherwise the question will just be closed.

Ludo - Neobis
on 11/12/14, 4:38 AM


| 5 4 8
Kochi, India
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

On 11/12/14, 5:47 AM

First you have to decide where you want to give onchange function and then give attribute on_change to that field,, for Eg:- let our field is sample_field

<field name="sample_field" on_change="onchange_sample_field(arg1, arg2)"/>

Here onchange_sample_field is my function name

Next step is to define that function:-

Define what you have to do in that function,, function definition Eg:-

    def onchange_sample_field(self, cr, uid, ids, arg1, arg2, context=None):
        function body
        return result


I have preparing a vehicle management system , if customer have two or more vehicles, and how onchange the vehicles no for one customer

on 11/13/14, 9:51 PM
On 11/12/14, 6:15 AM

my py file

class instalment_receipt_entry(osv.osv):
    _name = 'instalment.receipt.entry'
    _columns = {      'agreement_number_id': fields.many2one('agreement.number','Agreement Number'),

                               'receipt_no':fields.char('Receipt Number',size=64),


and my xml file 

   <field name="agreement_number_id"/>
    <field name="receipt_no"/>

how to onchange this 

on which field you want onchange?

on 11/12/14, 7:29 AM

receipt_no this fields i want change

on 11/12/14, 9:08 PM
I want changes in the receipt_no files

Thanks and Regards
Arunagiri k

On Wed, Nov 12, 2014 at 8:29 PM, Baiju KS <baijuks@hotmail.com> wrote:

on which field you want onchange?

Baiju KS
Sent by OpenERP S.A. using Odoo about Forum Post False

on 11/12/14, 11:07 PM

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

1 follower(s)


Asked: 11/12/14, 4:25 AM
Seen: 746 times
Last updated: 3/16/15, 8:10 AM