From 431dc688bba87e6882e876e27f5dfe803889192e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 20 Jun 2012 13:46:40 +0530 Subject: [PATCH] fix in file_list issue due to import data --- js/legacy/wn/widgets/form/attachments.js | 2 +- py/core/page/data_import_tool/data_import_tool.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/legacy/wn/widgets/form/attachments.js b/js/legacy/wn/widgets/form/attachments.js index 8df6c4ca7f..fa263d28fc 100644 --- a/js/legacy/wn/widgets/form/attachments.js +++ b/js/legacy/wn/widgets/form/attachments.js @@ -117,7 +117,7 @@ wn.widgets.form.sidebar.Attachment = function(parent, filedet, frm) { // download var display_name = this.fileid; - if(this.fileid.substr(0,8)=='FileData') + if(this.fileid && this.fileid.substr(0,8)=='FileData') display_name = this.filename; this.ln = $a(this.wrapper, 'a', 'link_type small', {}, display_name); this.ln.href = 'files/'+this.fileid; diff --git a/py/core/page/data_import_tool/data_import_tool.py b/py/core/page/data_import_tool/data_import_tool.py index 6063b600f8..99665c9efb 100644 --- a/py/core/page/data_import_tool/data_import_tool.py +++ b/py/core/page/data_import_tool/data_import_tool.py @@ -30,7 +30,7 @@ def get_template(): doctype_dl = webnotes.model.doctype.get(doctype) tablecolumns = [f[0] for f in webnotes.conn.sql('desc `tab%s`' % doctype)] - + def getinforow(docfield): """make info comment""" if docfield.fieldtype == 'Select': @@ -68,7 +68,7 @@ def get_template(): def append_row(t, mandatory): docfield = getdocfield(t) if docfield and ((mandatory and docfield.reqd) or (not mandatory and not docfield.reqd)) \ - and (t not in ('parenttype', 'trash_reason')): + and (t not in ('parenttype', 'trash_reason', 'file_list')): fieldrow.append(t) mandatoryrow.append(docfield.reqd and 'Yes' or 'No') typerow.append(docfield.fieldtype)