Hello,

I am trying to allow a password change for a kind of users. I can create 
those users, but I cannot modify the password by now...
The message says:

The field "Login Try" on "User" is required.

And my code is like this (the problem arises in the "else" part of the "if" 
sentence:


    password = 
fields.Function(fields.Char(u'ContraseƱa',required=True),'mensaje','crear')

    def mensaje(self,ids,name):
        res = {}
        for elem in self.browse(ids):
            res[elem.id] = "xxxxxxxxxxxxxxxxxxxx"
        return res

    def crear(self,ids,name,value):
        user_obj = Pool().get('res.user')
        for elem in self.browse(ids):
            yaCreados = user_obj.search([('login','=','elem.login')])
            #yaCreados=[3]
            if len(yaCreados)==0:
                
user_obj.create({'name':elem.name,'login':elem.login,'password':value})
            else:
                user_obj.write(yaCreados,{'password':value})
#                for usu in user_obj.browse(yaCreados):
                    
        return



I would appreciate any help.

Regards,
Miguel Tasende

-- 
-- 
[email protected] mailing list



Reply via email to