Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3604 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You also have to define else condition in function.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
4637
0
thg 3 15
3712
1
thg 3 15
4110
2
thg 2 17
7694
3
thg 10 16
6940