Merge branch 'develop'

This commit is contained in:
Saurabh 2017-05-13 07:42:03 +05:30
commit 154385db1b
5 changed files with 13 additions and 5 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '8.0.25'
__version__ = '8.0.26'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -13,7 +13,15 @@ def execute():
frappe.reload_doctype("Student Group")
student_batches = frappe.db.sql('''select name as student_group_name, student_batch_name as batch,
program, academic_year, academic_term from `tabStudent Batch`''', as_dict=1)
for student_batch in student_batches:
# create student batch name if does not exists !!
if student_batch.get("batch") and not frappe.db.exists("Student Batch Name", student_batch.get("batch")):
frappe.get_doc({
"doctype": "Student Batch Name",
"batch_name": student_batch.get("batch")
}).insert(ignore_permissions=True)
student_batch.update({"doctype":"Student Group", "group_based_on": "Batch"})
doc = frappe.get_doc(student_batch)
student_list = frappe.db.sql('''select student, student_name, active from `tabStudent Batch Student`

View File

@ -325,7 +325,7 @@ class Item(WebsiteGenerator):
def set_disabled_attributes(self, context):
"""Disable selection options of attribute combinations that do not result in a variant"""
if not self.attributes:
if not self.attributes or not self.has_variants:
return
context.disabled_attributes = {}

View File

@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, nowdate
from frappe.utils import cstr, nowdate, cint
from erpnext.setup.doctype.item_group.item_group import get_item_for_list_in_html
no_cache = 1
@ -33,7 +33,7 @@ def get_product_list(search=None, start=0, limit=12):
search = "%" + cstr(search) + "%"
# order by
query += """ order by weightage desc, idx desc, modified desc limit %s, %s""" % (start, limit)
query += """ order by weightage desc, idx desc, modified desc limit %s, %s""" % (cint(start), cint(limit))
data = frappe.db.sql(query, {
"search": search,

View File

@ -37,7 +37,7 @@ def get_level():
if frappe.db.count('Student') > 5:
activation_level += 1
if frappe.db.count('Student Batch') > 5:
if frappe.db.count('Student Batch Name') > 5:
activation_level += 1
if frappe.db.count('Instructor') > 5: