Skip to content Skip to sidebar Skip to footer

Onchange Function In Openerp

I have a selection field in account.invoice.line named form_type. It has three selection options: 1) form_a 2) form_b 3) form_c There is also an integer field named flag in accou

Solution 1:

In your on-change function you don't need to call the browse function of the object, because the values are not stored in the database yet. Also, you are passing the "form_type" value to the function and not the object id(as browse accepts object id).

So, below will be the on_change function, for the expected requirement:

def onchange_form_type(self, cr, uid, ids, form_type, context=None):

    val={}
    flag=0if form_type == 'form_c':
        flag="1"val = { 'flag': flag }
 return {'value': val}

Post a Comment for "Onchange Function In Openerp"