跳至內容
選單
此問題已被標幟
1 回覆
3592 瀏覽次數

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.

頭像
捨棄
最佳答案

You also have to define else condition in function.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
3月 15
4626
0
3月 15
3704
1
3月 15
4086
2
2月 17
7667
3
10月 16
6934