address now not in dialog, added slideshows in products and groups and removed transaction history from customer / supplier / sales partner

This commit is contained in:
Rushabh Mehta
2012-12-27 14:05:02 +05:30
parent 7285a720a0
commit 5f1d57ecb7
30 changed files with 528 additions and 764 deletions

View File

@@ -2,7 +2,10 @@
# License: GNU General Public License (v3). For more information see license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr
from website.utils import build_html, url_for_website, delete_page_cache
@webnotes.whitelist(allow_guest=True)
@@ -26,8 +29,6 @@ def get_product_info(item_code):
@webnotes.whitelist(allow_guest=True)
def get_product_list(search=None, product_group=None, start=0, limit=10):
from webnotes.utils import cstr
# base query
query = """select name, item_name, page_name, website_image, item_group,
web_long_description as website_description
@@ -81,7 +82,6 @@ def get_group_item_count(item_group):
where item_group in (%s))) """ % (child_groups, child_groups))[0][0]
def get_item_for_list_in_html(r):
from website.utils import build_html
scrub_item_for_list(r)
r.template = "html/product_in_list.html"
return build_html(r)
@@ -91,8 +91,7 @@ def scrub_item_for_list(r):
r.website_description = "No description given"
if len(r.website_description.split(" ")) > 24:
r.website_description = " ".join(r.website_description.split(" ")[:24]) + "..."
if r.website_image and not r.website_image.lower().startswith("http"):
r.website_image = "files/" + r.website_image
r.website_image = url_for_website(r.website_image)
def get_parent_item_groups(item_group_name):
item_group = webnotes.doc("Item Group", item_group_name)
@@ -102,6 +101,5 @@ def get_parent_item_groups(item_group_name):
order by lft asc""", (item_group.lft, item_group.rgt), as_dict=True)
def invalidate_cache_for(item_group):
from website.utils import delete_page_cache
for i in get_parent_item_groups(item_group):
delete_page_cache(i.page_name)

View File

@@ -0,0 +1,26 @@
# ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import webnotes
def get_slideshow(obj):
slideshow = webnotes.model_wrapper("Website Slideshow", obj.doc.slideshow)
obj.slides = slideshow.doclist.get({"doctype":"Website Slideshow Item"})
obj.doc.slideshow_header = slideshow.doc.header or ""
for s in obj.slides:
if s.image and not s.image.lower().startswith("http"):
s.image = "files/" + s.image