From 647e0d11649455524a2878871c600df691ba8631 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 18 Dec 2012 14:47:54 +0530 Subject: [PATCH 1/7] updates to product_page (search) and kb fix --- public/js/kb_common.js | 2 +- stock/doctype/item/item.txt | 5 +- utilities/page/questions/questions.py | 2 +- website/helpers/product.py | 89 ++----------------- website/templates/html/product_page.html | 12 ++- website/templates/html/product_search.html | 9 -- .../templates/html/product_search_box.html | 24 +++++ website/templates/pages/product_search.html | 88 ++++++++++++++++++ 8 files changed, 131 insertions(+), 100 deletions(-) delete mode 100644 website/templates/html/product_search.html create mode 100644 website/templates/html/product_search_box.html create mode 100644 website/templates/pages/product_search.html diff --git a/public/js/kb_common.js b/public/js/kb_common.js index 032d2db143..0686677692 100644 --- a/public/js/kb_common.js +++ b/public/js/kb_common.js @@ -33,7 +33,7 @@ KBItemToolbar = function(args, kb) { this.make_timestamp = function() { this.line1.innerHTML = repl('By %(name)s | %(when)s', { - name: wn.utils.full_name(this.det.first_name, this.det.last_name), + name: wn.user_info(this.det.owner).fullname, when: wn.datetime.comment_when(this.det.modified) }); diff --git a/stock/doctype/item/item.txt b/stock/doctype/item/item.txt index ce54443c35..10017a69a8 100644 --- a/stock/doctype/item/item.txt +++ b/stock/doctype/item/item.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-12-17 14:56:32", "modified_by": "Administrator", - "modified": "2012-12-17 16:02:00" + "modified": "2012-12-18 14:23:19" }, { "allow_attach": 1, @@ -823,11 +823,12 @@ "permlevel": 0 }, { + "description": "Will appear in search", "depends_on": "show_in_website", "doctype": "DocField", "label": "Short Description", "fieldname": "web_short_description", - "fieldtype": "Text", + "fieldtype": "Text Editor", "permlevel": 0 }, { diff --git a/utilities/page/questions/questions.py b/utilities/page/questions/questions.py index b38bc1ed42..20d38034fb 100644 --- a/utilities/page/questions/questions.py +++ b/utilities/page/questions/questions.py @@ -35,7 +35,7 @@ def get_questions(): conds += ' and t1._user_tags like "%'+ t +'%"' return webnotes.conn.sql("""select t1.name, t1.owner, t1.question, t1.modified, t1._user_tags, - t2.first_name, t2.last_name, (select count(*) from tabAnswer where + (select count(*) from tabAnswer where tabAnswer.question = t1.name) as answers from tabQuestion t1, tabProfile t2 where t1.docstatus!=2 diff --git a/website/helpers/product.py b/website/helpers/product.py index fec462607b..ceec17daec 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -25,14 +25,6 @@ def get_product_info(item_code): @webnotes.whitelist(allow_guest=True) def get_product_list(args=None): - """ - args = { - 'limit_start': 0, - 'limit_page_length': 20, - 'search': '', - 'product_group': '', - } - """ import webnotes from webnotes.utils import cstr @@ -40,11 +32,11 @@ def get_product_list(args=None): # base query query = """\ - select name, item_name, page_name, website_image, - description, web_short_description + select name, item_name, page_name, website_image, item_group, + if(ifnull(web_short_description,'')='', web_long_description, + web_short_description) as web_short_description from `tabItem` - where is_sales_item = 'Yes' - and docstatus = 0 + where docstatus = 0 and show_in_website = 1""" # search term condition @@ -65,75 +57,6 @@ def get_product_list(args=None): and item_group = %(product_group)s""" # order by - query += """ - order by item_name asc, name asc""" + query += """order by item_name asc, name asc limit %s, 10""" % args.start - from webnotes.widgets.query_builder import add_limit_to_query - query, args = add_limit_to_query(query, args) - - return webnotes.conn.sql(query, args, as_dict=1) - -@webnotes.whitelist(allow_guest=True) -def get_product_category_list(args=None): - """ - args = { - 'limit_start': 0, - 'limit_page_length': 5, - } - """ - import webnotes - - if not args: args = webnotes.form_dict - - query = """\ - select count(name) as items, item_group - from `tabItem` - where is_sales_item = 'Yes' - and docstatus = 0 - and show_in_website = 1 - group by item_group - order by items desc""" - - from webnotes.widgets.query_builder import add_limit_to_query - query, args = add_limit_to_query(query, args) - - - result = webnotes.conn.sql(query, args, as_dict=1) - - # add All Products link - total_count = sum((r.get('items') or 0 for r in result)) - result = [{'items': total_count, 'item_group': 'All Products'}] + (result or []) - - return result - -@webnotes.whitelist(allow_guest=True) -def get_similar_product_list(args=None): - """ - args = { - 'limit_start': 0, - 'limit_page_length': 5, - 'product_name': '', - 'product_group': '', - } - """ - import webnotes - - if not args: args = webnotes.form_dict - - query = """\ - select name, item_name, page_name, website_image, - description, web_short_description - from `tabItem` - where is_sales_item = 'Yes' - and docstatus = 0 - and show_in_website = 1 - and name != %(product_name)s - and item_group = %(product_group)s - order by item_name""" - - from webnotes.widgets.query_builder import add_limit_to_query - query, args = add_limit_to_query(query, args) - - result = webnotes.conn.sql(query, args, as_dict=1) - - return result \ No newline at end of file + return webnotes.conn.sql(query, args, as_dict=1) \ No newline at end of file diff --git a/website/templates/html/product_page.html b/website/templates/html/product_page.html index 80108f1820..50b306029a 100644 --- a/website/templates/html/product_page.html +++ b/website/templates/html/product_page.html @@ -20,15 +20,19 @@
- {% include 'html/product_search.html' %} + {% include 'html/product_search_box.html' %}

{{ item_name }}

{% if website_image %} {% else %} -
- This is an auto-generated Image +
+
+
+
+ {% endif %}

@@ -51,7 +55,7 @@ {% for d in obj.doclist.get( {"doctype":"Item Website Specification"}) %} - {{ d.label }} + {{ d.label }} {{ d.description }} {% endfor %} diff --git a/website/templates/html/product_search.html b/website/templates/html/product_search.html deleted file mode 100644 index 034ec112f8..0000000000 --- a/website/templates/html/product_search.html +++ /dev/null @@ -1,9 +0,0 @@ -
- -
-
\ No newline at end of file diff --git a/website/templates/html/product_search_box.html b/website/templates/html/product_search_box.html new file mode 100644 index 0000000000..3cbb3e9c81 --- /dev/null +++ b/website/templates/html/product_search_box.html @@ -0,0 +1,24 @@ +
+ + +
\ No newline at end of file diff --git a/website/templates/pages/product_search.html b/website/templates/pages/product_search.html new file mode 100644 index 0000000000..53a0572d69 --- /dev/null +++ b/website/templates/pages/product_search.html @@ -0,0 +1,88 @@ +{% extends "html/page.html" %} + +{% block title %}Product Search{% endblock %} + +{% block content %} + + +
+ +
+ +{% endblock %} \ No newline at end of file From fff3eb414230319d73192143bf9b2c5dc82db2d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 18 Dec 2012 14:57:49 +0530 Subject: [PATCH 2/7] Update production/doctype/bom/bom.py set is_default in current BOM when updating after submit --- production/doctype/bom/bom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/production/doctype/bom/bom.py b/production/doctype/bom/bom.py index ac21d21378..af0a7dd0e1 100644 --- a/production/doctype/bom/bom.py +++ b/production/doctype/bom/bom.py @@ -149,7 +149,8 @@ class DocType: def manage_default_bom(self): """ Uncheck others if current one is selected as default, update default bom in item master""" - + webnotes.conn.set(self.doc, "is_default", cint(self.doc.is_default)) + if self.doc.is_default and self.doc.is_active == 'Yes': sql("update `tabBOM` set is_default = 0 where name != %s and item=%s", (self.doc.name, self.doc.item)) From e109fa4fb8d16b57d66f2c976324c62d8e30dc9d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 19 Dec 2012 10:14:59 +0530 Subject: [PATCH 3/7] website updates and fix to sessions --- setup/doctype/item_group/item_group.js | 3 + setup/doctype/item_group/item_group.py | 19 +- setup/doctype/item_group/item_group.txt | 90 ++-- .../support_ticket/support_ticket_list.js | 2 +- .../website_settings/website_settings.txt | 469 ++++++++---------- website/helpers/product.py | 7 +- website/templates/css/products.css | 11 - website/templates/html/outer.html | 2 +- website/templates/html/product_group.html | 34 ++ website/templates/html/product_page.html | 6 +- .../templates/html/product_search_box.html | 8 +- website/templates/js/blog.js | 13 +- website/templates/js/blog_subscribe.js | 33 -- website/templates/js/product_category.js | 18 - website/templates/js/products.js | 106 ---- website/templates/pages/404.html | 2 +- website/templates/pages/blog.html | 5 +- website/templates/pages/error.html | 11 + website/templates/pages/product_search.html | 15 +- website/templates/pages/products.html | 37 -- website/utils.py | 37 +- 21 files changed, 403 insertions(+), 525 deletions(-) delete mode 100644 website/templates/css/products.css delete mode 100644 website/templates/js/blog_subscribe.js delete mode 100644 website/templates/js/product_category.js delete mode 100644 website/templates/js/products.js create mode 100644 website/templates/pages/error.html delete mode 100644 website/templates/pages/products.html diff --git a/setup/doctype/item_group/item_group.js b/setup/doctype/item_group/item_group.js index db894fa9d6..6bb6fe309d 100644 --- a/setup/doctype/item_group/item_group.js +++ b/setup/doctype/item_group/item_group.js @@ -17,6 +17,9 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.set_root_readonly(doc); + cur_frm.add_custom_button("Item Group Tree", function() { + wn.set_route("Sales Browser", "Item Group"); + }) } cur_frm.cscript.set_root_readonly = function(doc) { diff --git a/setup/doctype/item_group/item_group.py b/setup/doctype/item_group/item_group.py index 2cec30dd1a..81c5d80af2 100644 --- a/setup/doctype/item_group/item_group.py +++ b/setup/doctype/item_group/item_group.py @@ -24,4 +24,21 @@ class DocType(DocTypeNestedSet): def __init__(self, doc, doclist=[]): self.doc = doc self.doclist = doclist - self.nsm_parent_field = 'parent_item_group'; \ No newline at end of file + self.nsm_parent_field = 'parent_item_group'; + + def on_update(self): + if self.doc.show_in_website: + # webpage updates + from website.utils import update_page_name + page_name = self.doc.name + if webnotes.conn.get_value("Website Settings", None, + "default_product_category")==self.doc.name: + page_name = "products" + + update_page_name(self.doc, self.doc.name) + + def prepare_template_args(self): + self.doc.sub_groups = webnotes.conn.sql("""select name, page_name + from `tabItem Group` where parent_item_group=%s + and ifnull(show_in_website,0)=1""", self.doc.name, as_dict=1) + \ No newline at end of file diff --git a/setup/doctype/item_group/item_group.txt b/setup/doctype/item_group/item_group.txt index 411869bf20..1a3e0637ed 100644 --- a/setup/doctype/item_group/item_group.txt +++ b/setup/doctype/item_group/item_group.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2012-12-07 15:15:28", "modified_by": "Administrator", - "modified": "2012-12-17 15:00:01" + "modified": "2012-12-18 16:23:48" }, { "in_create": 1, @@ -12,11 +12,13 @@ "module": "Setup", "autoname": "field:item_group_name", "document_type": "Master", - "description": "Item Classification", + "allow_attach": 1, "issingle": 0, "name": "__common__", "allow_rename": 1, - "doctype": "DocType" + "description": "Item Classification", + "doctype": "DocType", + "max_attachments": 3 }, { "name": "__common__", @@ -49,33 +51,6 @@ "search_index": 0, "reqd": 1 }, - { - "description": "Check this if you want to show in website", - "no_copy": 0, - "search_index": 0, - "doctype": "DocField", - "label": "Show in Website", - "fieldname": "show_in_website", - "fieldtype": "Check" - }, - { - "depends_on": "show_in_website", - "doctype": "DocField", - "label": "Featured Items HTML", - "fieldname": "featured_items_html", - "fieldtype": "HTML", - "options": "

Featured Items

" - }, - { - "description": "Items Featured on the Item Group Page", - "depends_on": "show_in_website", - "doctype": "DocField", - "label": "Featured Items", - "fieldname": "featured_items", - "fieldtype": "Table", - "hidden": 1, - "options": "Featured Item" - }, { "doctype": "DocField", "label": "Page Name", @@ -112,6 +87,45 @@ "reqd": 1, "options": "\nYes\nNo" }, + { + "doctype": "DocField", + "label": "Website Settings", + "fieldname": "sb9", + "fieldtype": "Section Break" + }, + { + "description": "Check this if you want to show in website", + "no_copy": 0, + "search_index": 0, + "doctype": "DocField", + "label": "Show in Website", + "fieldname": "show_in_website", + "fieldtype": "Check" + }, + { + "depends_on": "show_in_website", + "doctype": "DocField", + "label": "Description", + "fieldname": "description", + "fieldtype": "Text Editor" + }, + { + "depends_on": "show_in_website", + "doctype": "DocField", + "label": "Featured Items", + "fieldname": "featured_items_html", + "fieldtype": "Section Break" + }, + { + "description": "Items Featured on the Item Group Page", + "depends_on": "show_in_website", + "doctype": "DocField", + "label": "Featured Items", + "fieldname": "featured_items", + "fieldtype": "Table", + "hidden": 0, + "options": "Featured Item" + }, { "print_hide": 1, "no_copy": 1, @@ -154,6 +168,22 @@ "options": "Item Group", "report_hide": 1 }, + { + "doctype": "DocField", + "label": "file_list", + "fieldname": "file_list", + "fieldtype": "Text", + "hidden": 1 + }, + { + "print_hide": 1, + "no_copy": 1, + "doctype": "DocField", + "label": "File List", + "fieldname": "file_list", + "fieldtype": "Text", + "hidden": 1 + }, { "amend": 0, "create": 0, diff --git a/support/doctype/support_ticket/support_ticket_list.js b/support/doctype/support_ticket/support_ticket_list.js index 2d6090c358..9dc84827bc 100644 --- a/support/doctype/support_ticket/support_ticket_list.js +++ b/support/doctype/support_ticket/support_ticket_list.js @@ -15,7 +15,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ label_style: { "status": { - "Open": "danger", + "Open": "important", "Closed": "success", "Hold": "info", "Waiting for Customer": "info" diff --git a/website/doctype/website_settings/website_settings.txt b/website/doctype/website_settings/website_settings.txt index 3ae0fbe244..b6429655d7 100644 --- a/website/doctype/website_settings/website_settings.txt +++ b/website/doctype/website_settings/website_settings.txt @@ -1,256 +1,217 @@ -# DocType, Website Settings [ - - # These values are common in all dictionaries - { - 'creation': '2012-05-21 15:54:09', - 'docstatus': 0, - 'modified': '2012-07-09 16:20:58', - 'modified_by': u'Administrator', - 'owner': u'Administrator' - }, - - # These values are common for all DocType - { - '_last_update': u'1329115882', - 'allow_attach': 1, - 'colour': u'White:FFF', - 'doctype': 'DocType', - 'document_type': u'Other', - 'issingle': 1, - 'max_attachments': 10, - 'module': u'Website', - 'name': '__common__', - 'section_style': u'Simple', - 'show_in_menu': 0, - 'version': 1 - }, - - # These values are common for all DocField - { - 'doctype': u'DocField', - 'name': '__common__', - 'parent': u'Website Settings', - 'parentfield': u'fields', - 'parenttype': u'DocType' - }, - - # These values are common for all DocPerm - { - 'doctype': u'DocPerm', - 'name': '__common__', - 'parent': u'Website Settings', - 'parentfield': u'permissions', - 'parenttype': u'DocType', - 'read': 1 - }, - - # DocType, Website Settings - { - 'doctype': 'DocType', - 'name': u'Website Settings' - }, - - # DocPerm - { - 'create': 1, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'System Manager', - 'write': 1 - }, - - # DocPerm - { - 'create': 1, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Website Manager', - 'write': 1 - }, - - # DocPerm - { - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'All' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'top_bar', - 'fieldtype': u'Section Break', - 'label': u'Top Bar', - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'description': u'The name of your company / website as you want to appear on browser title bar. All pages will have this as the prefix to the title.', - 'doctype': u'DocField', - 'fieldname': u'title_prefix', - 'fieldtype': u'Data', - 'label': u'Title Prefix', - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'description': u'The "Web Page" that is the website home page', - 'doctype': u'DocField', - 'fieldname': u'home_page', - 'fieldtype': u'Link', - 'label': u'Home Page', - 'options': u'Web Page', - 'permlevel': 0, - 'reqd': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'default_product_category', - 'fieldtype': u'Link', - 'label': u'Default Product Category', - 'options': u'Item Group', - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'description': u'Brand is what appears on the top-right of the toolbar. If it is an image, make sure it\nhas a transparent background and use the <img /> tag', - 'doctype': u'DocField', - 'fieldname': u'brand_html', - 'fieldtype': u'Text', - 'label': u'Brand HTML', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'top_bar_items', - 'fieldtype': u'Table', - 'label': u'Top Bar Items', - 'options': u'Top Bar Item', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'footer', - 'fieldtype': u'Section Break', - 'label': u'Footer', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'address', - 'fieldtype': u'Text', - 'label': u'Address', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'copyright', - 'fieldtype': u'Data', - 'label': u'Copyright', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'footer_items', - 'fieldtype': u'Table', - 'label': u'Footer Items', - 'options': u'Top Bar Item', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'misc_section', - 'fieldtype': u'Section Break', - 'label': u'Misc', - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'description': u'An icon file with .ico extension. Should be 16 x 16 px. Generated using a favicon generator. [favicon-generator.org]', - 'doctype': u'DocField', - 'fieldname': u'favicon', - 'fieldtype': u'Select', - 'label': u'FavIcon', - 'options': u'attach_files:', - 'permlevel': 0 - }, - - # DocField - { - 'description': u'Sub-domain provided by erpnext.com', - 'doctype': u'DocField', - 'fieldname': u'subdomain', - 'fieldtype': u'Text', - 'label': u'Subdomain', - 'permlevel': 1, - 'reqd': 0 - }, - - # DocField - { - 'description': u'Enter domain names associated to this website, each on a new line', - 'doctype': u'DocField', - 'fieldname': u'domain_list', - 'fieldtype': u'Text', - 'hidden': 1, - 'label': u'Domain List', - 'permlevel': 0, - 'reqd': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'file_list', - 'fieldtype': u'Text', - 'hidden': 1, - 'label': u'File List', - 'no_copy': 1, - 'permlevel': 0, - 'print_hide': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'analytics', - 'fieldtype': u'Section Break', - 'label': u'Startup', - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'description': u'Bind events on startup and page change', - 'doctype': u'DocField', - 'fieldname': u'startup_code', - 'fieldtype': u'Code', - 'label': u'Startup Code', - 'options': u'Javascript', - 'permlevel': 0 - } + { + "owner": "Administrator", + "docstatus": 0, + "creation": "2012-07-12 23:29:36", + "modified_by": "Administrator", + "modified": "2012-12-18 16:15:43" + }, + { + "issingle": 1, + "allow_attach": 1, + "doctype": "DocType", + "module": "Website", + "max_attachments": 10, + "document_type": "Other", + "name": "__common__" + }, + { + "name": "__common__", + "parent": "Website Settings", + "doctype": "DocField", + "parenttype": "DocType", + "parentfield": "fields" + }, + { + "name": "__common__", + "parent": "Website Settings", + "read": 1, + "doctype": "DocPerm", + "parenttype": "DocType", + "parentfield": "permissions" + }, + { + "name": "Website Settings", + "doctype": "DocType" + }, + { + "doctype": "DocField", + "label": "Landing Page", + "fieldname": "sb0", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "The \"Web Page\" that is the website home page", + "doctype": "DocField", + "label": "Home Page", + "options": "Web Page", + "fieldname": "home_page", + "fieldtype": "Link", + "reqd": 1, + "permlevel": 0 + }, + { + "description": "The name of your company / website as you want to appear on browser title bar. All pages will have this as the prefix to the title.", + "doctype": "DocField", + "label": "Title Prefix", + "fieldname": "title_prefix", + "fieldtype": "Data", + "permlevel": 0 + }, + { + "doctype": "DocField", + "fieldname": "cb4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Only Items / Groups under this Groups will be shown on the website. This will also represent the \"Products\" Home Page.", + "doctype": "DocField", + "label": "Default Product Category", + "options": "Item Group", + "fieldname": "default_product_category", + "fieldtype": "Link", + "permlevel": 0 + }, + { + "description": "If checked, the Home page will be the default Item Group for the website.", + "doctype": "DocField", + "label": "Home Page is Products", + "fieldname": "home_page_is_products", + "fieldtype": "Check", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Top Bar", + "fieldname": "top_bar", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Brand is what appears on the top-right of the toolbar. If it is an image, make sure it\nhas a transparent background and use the <img /> tag. Keep size as 200px x 30px", + "doctype": "DocField", + "label": "Brand HTML", + "fieldname": "brand_html", + "fieldtype": "Text", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Top Bar Items", + "options": "Top Bar Item", + "fieldname": "top_bar_items", + "fieldtype": "Table", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Footer", + "fieldname": "footer", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Address", + "fieldname": "address", + "fieldtype": "Text", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Copyright", + "fieldname": "copyright", + "fieldtype": "Data", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Footer Items", + "options": "Top Bar Item", + "fieldname": "footer_items", + "fieldtype": "Table", + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Misc", + "fieldname": "misc_section", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "An icon file with .ico extension. Should be 16 x 16 px. Generated using a favicon generator. [favicon-generator.org]", + "doctype": "DocField", + "label": "FavIcon", + "options": "attach_files:", + "fieldname": "favicon", + "fieldtype": "Select", + "permlevel": 0 + }, + { + "description": "Sub-domain provided by erpnext.com", + "doctype": "DocField", + "label": "Subdomain", + "fieldname": "subdomain", + "fieldtype": "Text", + "reqd": 0, + "permlevel": 1 + }, + { + "description": "Enter domain names associated to this website, each on a new line", + "doctype": "DocField", + "label": "Domain List", + "fieldname": "domain_list", + "fieldtype": "Text", + "reqd": 0, + "hidden": 1, + "permlevel": 0 + }, + { + "print_hide": 1, + "no_copy": 1, + "doctype": "DocField", + "label": "File List", + "fieldname": "file_list", + "fieldtype": "Text", + "hidden": 1, + "permlevel": 0 + }, + { + "doctype": "DocField", + "label": "Startup", + "fieldname": "analytics", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Bind events on startup and page change", + "doctype": "DocField", + "label": "Startup Code", + "options": "Javascript", + "fieldname": "startup_code", + "fieldtype": "Code", + "permlevel": 0 + }, + { + "create": 1, + "doctype": "DocPerm", + "write": 1, + "role": "System Manager", + "permlevel": 0 + }, + { + "create": 1, + "doctype": "DocPerm", + "write": 1, + "role": "Website Manager", + "permlevel": 0 + }, + { + "doctype": "DocPerm", + "role": "All", + "permlevel": 1 + } ] \ No newline at end of file diff --git a/website/helpers/product.py b/website/helpers/product.py index ceec17daec..60d54e67f0 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -29,6 +29,7 @@ def get_product_list(args=None): from webnotes.utils import cstr if not args: args = webnotes.form_dict + if not args.search: args.search = "" # base query query = """\ @@ -37,10 +38,10 @@ def get_product_list(args=None): web_short_description) as web_short_description from `tabItem` where docstatus = 0 - and show_in_website = 1""" + and show_in_website = 1 """ # search term condition - if args.get('search'): + if args.search: query += """ and ( web_short_description like %(search)s or @@ -54,7 +55,7 @@ def get_product_list(args=None): # product group condition if args.get('product_group') and args.get('product_group') != 'All Products': query += """ - and item_group = %(product_group)s""" + and item_group = %(product_group)s """ # order by query += """order by item_name asc, name asc limit %s, 10""" % args.start diff --git a/website/templates/css/products.css b/website/templates/css/products.css deleted file mode 100644 index 73289c4e20..0000000000 --- a/website/templates/css/products.css +++ /dev/null @@ -1,11 +0,0 @@ - \ No newline at end of file diff --git a/website/templates/html/outer.html b/website/templates/html/outer.html index 9741451a43..1580cbe143 100644 --- a/website/templates/html/outer.html +++ b/website/templates/html/outer.html @@ -9,7 +9,7 @@