Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3631 Visualizzazioni

I have a problem in Odoo 9, I get 500 Internal Server Error when I create a function field with orv.orv model.

This is the field:

'usuario_logeado': fields.function(_usuario_logeado),

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

        

        result = {}

        rec=self.pool.get('res.users').browse(cr,uid,uid)

        

        for hol in self.browse(cr, uid, ids, context=context):

            if hol.empleado_horas_extras == rec:

                result[hol.id] = 2

                

        return result


The field is in the xml view too, I can't find the problem, anyone could help me? Thanks.

Avatar
Abbandona
Risposta migliore

You also have to define else condition in function.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mar 15
4672
0
mar 15
3722
1
mar 15
4136
2
feb 17
7727
3
ott 16
6974