diff --git a/erpnext/patches/jan_mar_2012/website/file_data_rename.py b/erpnext/patches/jan_mar_2012/website/file_data_rename.py index aff25db702..2cd5e68cd3 100644 --- a/erpnext/patches/jan_mar_2012/website/file_data_rename.py +++ b/erpnext/patches/jan_mar_2012/website/file_data_rename.py @@ -12,7 +12,6 @@ def execute(): change_file_data_in_tabseries() replace_file_list_column_entries() - def replace_name_in_file_data(): """ Change / to - in tabFile Data name column entries diff --git a/erpnext/patches/jan_mar_2012/website/getfile_rename.py b/erpnext/patches/jan_mar_2012/website/getfile_rename.py new file mode 100644 index 0000000000..8f7cede659 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/website/getfile_rename.py @@ -0,0 +1,44 @@ +import webnotes + +def execute(): + """rename from getfle""" + l = [ + ('Quotation Detail', 'description'), + ('Sales Order Detail', 'description'), + ('Delivery Note Detail', 'description'), + ('RV Detail', 'description'), + ('Item', 'description_html'), + ('Letter Head', 'content') + ] + + import re + + for table in l: + for item in webnotes.conn.sql("""select name, %s from `tab%s` + where %s like '%s'""" % (table[1], table[0], table[1], '%cgi-bin/getfile.cgi%')): + txt = re.sub('\&acx=[^"\']*', '', item[1])\ + .replace('cgi-bin/getfile.cgi?name=', 'files/')\ + .replace('FileData/', 'FileData-') + + txt = get_file_id(txt) + + webnotes.conn.sql("""update `tab%s` set %s=%s where name=%s""" % \ + (table[0], table[1], '%s', '%s'), (txt, item[0]), debug=1) + + # control panel, client name + txt = webnotes.conn.get_value('Control Panel',None,'client_name') + txt = get_file_id(txt) + webnotes.conn.set_value('Control Panel', None, 'client_name', txt.replace('index.cgi?cmd=get_file&fname=', 'files/')) + +def get_file_id(txt): + """old file links may be from fileid or filename""" + import re + match = re.search('files/([^"\']*)', txt) + fname = match.groups()[0] + if not fname.startswith('FileData'): + fid = webnotes.conn.sql("""select name from `tabFile Data` + where file_name=%s""", fname) + if fid: + fid = fid[0][0].replace('/', '-') + txt = txt.replace(fname, fid) + return txt \ No newline at end of file diff --git a/erpnext/setup/doctype/personalize/personalize.py b/erpnext/setup/doctype/personalize/personalize.py index dc9ad66fd4..552532df87 100644 --- a/erpnext/setup/doctype/personalize/personalize.py +++ b/erpnext/setup/doctype/personalize/personalize.py @@ -29,4 +29,6 @@ class DocType: # def set_html_from_image(self): file_name = self.doc.file_list.split(',')[0] - self.doc.header_html = '
' + self.doc.header_html = """
+ +
""" % file_name diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js index 1bf1f2e5c8..2e728f687f 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.js +++ b/erpnext/stock/doctype/packing_slip/packing_slip.js @@ -29,7 +29,6 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { var ps_detail = getchildren('Packing Slip Detail', doc.name, 'item_details'); if(!(flt(ps_detail[0].net_weight) && cstr(ps_detail[0].weight_uom))) { cur_frm.cscript.update_item_details(doc); - refresh_field('naming_series'); } } } @@ -41,6 +40,7 @@ cur_frm.cscript.update_item_details = function(doc) { msgprint(r.exc); } else { refresh_field('item_details'); + refresh_field('naming_series'); } }); } diff --git a/erpnext/website/doctype/products_settings/products_settings.py b/erpnext/website/doctype/products_settings/products_settings.py index 195f37f8ac..118ba4f20c 100644 --- a/erpnext/website/doctype/products_settings/products_settings.py +++ b/erpnext/website/doctype/products_settings/products_settings.py @@ -12,4 +12,7 @@ class DocType: tmp = json.dumps({"item_group": d.item_group, "label":d.label}) break - webnotes.conn.set_default("default_product_category", tmp) \ No newline at end of file + webnotes.conn.set_default("default_product_category", tmp) + + from webnotes.session_cache import clear_cache + clear_cache('Guest') \ No newline at end of file diff --git a/erpnext/website/page/products/products.html b/erpnext/website/page/products/products.html index 6c4fa97b17..3e460d269b 100644 --- a/erpnext/website/page/products/products.html +++ b/erpnext/website/page/products/products.html @@ -1,7 +1,7 @@

- diff --git a/erpnext/website/page/products/products.js b/erpnext/website/page/products/products.js index b9fa167514..28baaeca77 100644 --- a/erpnext/website/page/products/products.js +++ b/erpnext/website/page/products/products.js @@ -65,7 +65,7 @@ erpnext.products.make_product_list = function(wrapper) { parent.innerHTML = repl('
\
\
\ - %(title)s\ +

%(title)s

\

%(short_description)s

\
', data); } diff --git a/js/all-app.js b/js/all-app.js index 178ca27a50..e0da79b072 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -427,7 +427,7 @@ return"";else return decodeURIComponent(results[1]);},get_dict:function(){var d={} var t=window.location.href.split('?')[1];if(!t)return d;if(t.indexOf('#')!=-1)t=t.split('#')[0];if(!t)return d;t=t.split('&');for(var i=0;i