Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3733 Tampilan

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
Buang
Jawaban Terbai

You also have to define else condition in function.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Mar 15
4777
0
Mar 15
3876
1
Mar 15
4273
2
Feb 17
7870
3
Okt 16
7097