Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make the onchange function in OpenERP(Odoo) ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 2.88k
    Comment on it

    In onchange function first we have to go in .py file (python file)
    After that we have to decide where you want to give onchange function and then give attribute on_change to that field.
    Like below python code in py file :

     def onchange_function(self, cr, uid,ids,qualification, context=None):
            print"=====qualification======",qualification
            if qualification=='a1':
                a1 = 'Shiva1'
            elif qualification=='a2':
                a2 = 'Shiva2'
            else:
                a3 = 'shiva3' 
            print"=====a1====",a1
            obj = self.pool.get('hr.role1').search(cr ,uid ,[('name','=',a1)])
            print"=====obj====",obj
            a2 = self.pool.get('hr.role1').browse(cr, uid, obj, context)
            for val in a2:
                print"=====a2====",val,val.id
    
                values = {
    
                    'termination1' : val.id,
    
    
                }
            return {'value' : values} 

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: