if ir_value_ids:
ir_values_obj.unlink(cr, uid, ir_value_ids, context=context)
+ # For the same reason, removing the record relevant to ir_attachment
+ # The search is performed with sql as the search method of ir_attachment is overridden to hide attachments of deleted records
+ cr.execute('select id from ir_attachment where res_model = %s and res_id in %s', (self._name, sub_ids))
+ ir_attachment_ids = [ir_attachment[0] for ir_attachment in cr.fetchall()]
+ if ir_attachment_ids:
+ ir_attachment_obj.unlink(cr, uid, ir_attachment_ids, context=context)
+
- for order, object, store_ids, fields in result_store:
- if object == self._name:
+ for order, obj_name, store_ids, fields in result_store:
+ if obj_name == self._name:
effective_store_ids = list(set(store_ids) - set(ids))
else:
effective_store_ids = store_ids