From 6e5f52a548a5d95b7625e9ba02bb99c358fbe6d8 Mon Sep 17 00:00:00 2001 From: EL HADJI DEM Date: Wed, 19 Mar 2014 11:30:13 -0400 Subject: [PATCH] [IMP]Change condition to pass test --- document_multiple_records/document.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/document_multiple_records/document.py b/document_multiple_records/document.py index 5d72efe4..e9dbc0af 100644 --- a/document_multiple_records/document.py +++ b/document_multiple_records/document.py @@ -36,12 +36,10 @@ class document_file(orm.Model): ir_attachment_document_obj = self.pool.get('ir.attachment.document') original_data = {key: data[key] for key in data.keys()} # Don't save this information below - if data['res_model']: - data['res_model'] = '' - if data['res_id']: - data['res_id'] = '' - if data['res_name']: - data['res_name'] = '' + if ('res_name', 'res_id', 'res_name') in data.keys(): + data['res_model'] = False + data['res_id'] = False + data['res_name'] = False res = super(document_file, self).create(cr, uid, data, context=context) # Create attachment_document_ids with res_model, res_id and res_name if 'res_model' and 'res_id' in original_data: