resolve_o2m_commands_to_record_dicts

Bug #1176823 reported by Milan Tribuson
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Sometimes this function returns a key error for some lines when changing a value in account move lines in account move form and i don't know why or when. Changing the original code from:

        records_by_id = dict(
            (record['id'], record)
            for record in self.pool.get(o2m_model).read(
                cr, uid, ids_to_read, fields=fields, context=context))

to:

        records_by_id = {}
        for record_id in ids_to_read:
            records_by_id[record_id] = self.pool.get(o2m_model).read(cr, uid, record_id, fields=fields, context=context)

solves the problem... Anyone knows why?

Amit Parik (amit-parik)
affects: openobject-addons → openobject-server
Revision history for this message
Javier Llamas (javierllamas) wrote :

Hi,

I have the same problem.

Bye.

Revision history for this message
Javier Llamas (javierllamas) wrote :

The solution is correct. Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.