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

@@ -95,7 +95,10 @@ cur_frm.cscript.tax_type = function(doc, cdt, cdn){
//get query select item group
cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.`is_group` = "No" AND `tabItem Group`.`docstatus`!= 2 AND `tabItem Group`.%(key)s LIKE "%s" ORDER BY `tabItem Group`.`name` ASC LIMIT 50'
return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` \
FROM `tabItem Group` WHERE `tabItem Group`.`docstatus`!= 2 AND \
`tabItem Group`.%(key)s LIKE "%s" ORDER BY `tabItem Group`.`name` \
ASC LIMIT 50'
}
// for description from attachment

View File

@@ -182,15 +182,10 @@ class DocType:
ret = {
'file_group' : file and file[0]['file_group'] or '',
'description' : file and file[0]['description'] or ''
}
return ret
def check_if_sle_exists(self):
"""
checks if any stock ledger entry exists for this item
"""
sle = sql("select name from `tabStock Ledger Entry` where item_code = %s and ifnull(is_cancelled, 'No') = 'No'", self.doc.name)
return sle and 'exists' or 'not exists'
@@ -201,4 +196,5 @@ class DocType:
clear_cache(self.doc.page_name)
def prepare_template_args(self):
self.doc.web_description_html = self.doc.description or ''
from website.helpers.product import get_parent_item_groups
self.parent_groups = get_parent_item_groups(self.doc.item_group) + [{"name":self.doc.name}]

View File

@@ -4,7 +4,7 @@
"docstatus": 0,
"creation": "2012-12-17 14:56:32",
"modified_by": "Administrator",
"modified": "2012-12-20 15:59:41"
"modified": "2012-12-25 13:52:47"
},
{
"allow_attach": 1,
@@ -815,6 +815,16 @@
"fieldtype": "Link",
"permlevel": 0
},
{
"description": "List this Item in multiple groups on the website.",
"depends_on": "show_in_website",
"doctype": "DocField",
"label": "Website Item Groups",
"options": "Website Item Group",
"fieldname": "website_item_groups",
"fieldtype": "Table",
"permlevel": 0
},
{
"depends_on": "show_in_website",
"doctype": "DocField",