Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
3600 Näkymät

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
Hylkää
Paras vastaus

You also have to define else condition in function.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
maalisk. 15
4631
0
maalisk. 15
3709
1
maalisk. 15
4108
2
helmik. 17
7679
3
lokak. 16
6938