← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 613415] Re: Trouble when o2m referencial record is removed and read is accessed!

 

*** This bug is a duplicate of bug 603708 ***
    https://bugs.launchpad.net/bugs/603708

** This bug has been marked a duplicate of bug 603708
   fields.py : correction on get() of O2M
 * You can subscribe to bug 603708 by following this link: https://bugs.launchpad.net/openobject-server/+bug/603708/+subscribe

-- 
Trouble when o2m referencial record is removed and read is accessed!
https://bugs.launchpad.net/bugs/613415
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: New

Bug description:
Hello all,
I just updated this morning my server with the last version (5.0.12). Then, when trying to open sale orders or invoices, i get the message  I posted here after.

I checked the error and there's something to see with reports. I traced the following  function of the fields.py

def search_memory(self, cr, obj, args, name, value, offset=0, limit=None, uid=None, operator='like', context=None):
...
        print 'valeur de obj : ',obj
        print 'Valeur de ids : ',ids
        ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
        print 'valeur de ids2 : ',ids2
        for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
            print 'Valeur de r : ',r
            res[r[self._fields_id]].append(r['id'])
        return res

and here's what was displayed :

valeur de obj :  <osv.osv.ir.actions.report.xml object at 0x97f13ac>
Valeur de ids :  []
valeur de ids2 :  [1, 3, 4, 9, 10, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 35, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 55, 56, 57, 58, 59, 60, 61]
Valeur de r :  {'id': 1, 'report_id': 700}

here's the error message :

  File "/usr/lib/openerp-server/osv/fields.py", line 431, in get
    res[r[self._fields_id]].append(r['id'])
KeyError: 700

I checked the table ir_act_report_xml and there's an id 700 :

I post the printscreen of the part of the ir_act_report_xml wich contains the id 700