-def resolve_o2m_operations(cr, uid, target_osv, operations, fields, context):
- results = []
- for operation in operations:
- result = None
- if not isinstance(operation, (list, tuple)):
- result = target_osv.read(cr, uid, operation, fields, context=context)
- elif operation[0] == 0:
- # may be necessary to check if all the fields are here and get the default values?
- result = operation[2]
- elif operation[0] == 1:
- result = target_osv.read(cr, uid, operation[1], fields, context=context)
- if not result: result = {}
- result.update(operation[2])
- elif operation[0] == 4:
- result = target_osv.read(cr, uid, operation[1], fields, context=context)
- if result != None:
- results.append(result)
- return results
-
-