Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd

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?

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
okt. 24
967
1
apr. 19
7160
0
mei 16
3321
2
dec. 15
3482
2
okt. 21
3855