Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

I was getting traceback error while filling timesheet. After R&D I came to know that it was the issue of Odoo’s code it self. I compared code with the latest one and found the issue.

The Problem:

The method is called from function field. I have overridden it successfully but the problem is, after overriding it, it is calling first the original method of Odoo and after that, it is calling my overridden method. That’s why I am facing the same traceback error.

Here is default code:

def _get_task(self, cr, uid, id, context=None):

  res = []

  for line in self.pool.get('account.analytic.line').search_read(cr,uid,[('task_id', '!=', False),('id','in',id)], context=context):

      res.append(line['task_id'][0])

  return res


Here is my overridden code after bug fixed by Odoo:

def _get_task(self, cr, uid, id, context=None):

  res = []

     for line in self.pool.get('account.analytic.line').search_read(cr, uid,[('task_id', '!=', False), ('id', 'in', id)], ['task_id'], context=context):

      res.append(line['task_id'][0])

  return res

The only difference between these two is the [‘task_id’] which is added in the search_read method. Can anybody help me out regarding it?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 24
967
1
thg 4 19
7160
0
thg 5 16
3321
2
thg 12 15
3482
2
thg 10 21
3855