Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait
2012-12-25 18:17:16 +05:30
20 changed files with 197 additions and 89 deletions

View File

@@ -27,6 +27,7 @@ class DocType(DocTypeNestedSet):
self.nsm_parent_field = 'parent_item_group';
def on_update(self):
super(DocType, self).on_update()
if self.doc.show_in_website:
# webpage updates
from website.utils import update_page_name
@@ -38,6 +39,16 @@ class DocType(DocTypeNestedSet):
update_page_name(self.doc, self.doc.name)
def prepare_template_args(self):
from website.helpers.product import get_product_list_for_group, \
get_parent_item_groups, get_group_item_count
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)
and ifnull(show_in_website,0)=1""", self.doc.name, as_dict=1)
for d in self.doc.sub_groups:
d.count = get_group_item_count(d.name)
self.doc.items = get_product_list_for_group(product_group = self.doc.name, limit=20)
self.parent_groups = get_parent_item_groups(self.doc.name)

View File

@@ -3,7 +3,7 @@
<h1>Modules Setup</h1>
<hr>
<div class="help" style="width: 300px; float: right">
Select checkbox to show / hide module. Drag around to move order.
Select checkbox to show / hide module.
</div>
<div id="modules-list">
</div>

View File

@@ -4,7 +4,7 @@ $.extend(wn.pages.modules_setup, {
modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Manufacturing', 'Projects',
'Support', 'HR', 'Website', 'To Do', 'Messages', 'Calendar', 'Knowledge Base'],
onload: function(wrapper) {
wn.pages.modules_setup.refresh_page(wn.boot.modules_list);
wn.pages.modules_setup.refresh_page(JSON.parse(wn.boot.modules_list || "[]"));
},
refresh_page: function(ml) {
$('#modules-list').empty();
@@ -30,8 +30,6 @@ $.extend(wn.pages.modules_setup, {
}
}
$('#modules-list').sortable();
},
update: function() {
var ml = [];