Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
říj 24
969
1
dub 19
7160
0
kvě 16
3323
2
pro 15
3482
2
říj 21
3856