Merge branch 'master' into develop

This commit is contained in:
Saurabh 2017-11-10 13:15:04 +05:30
commit 7b78a83592
6 changed files with 28 additions and 12 deletions

View File

@ -4,7 +4,7 @@ import inspect
import frappe
from erpnext.hooks import regional_overrides
__version__ = '9.2.7'
__version__ = '9.2.8'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -185,7 +185,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals
"page_len": page_len
}, as_dict=as_dict)
def bom(doctype, txt, searchfield, start, page_len, filters):
def bom(doctype, txt, searchfield, filters, start=0, page_len=20):
conditions = []
return frappe.db.sql("""select tabBOM.name, tabBOM.item

View File

@ -458,4 +458,5 @@ erpnext.patches.v9_0.set_uoms_in_variant_field
erpnext.patches.v9_0.copy_old_fees_field_data
execute:frappe.delete_doc_if_exists("DocType", "Program Fee")
erpnext.patches.v9_0.set_pos_profile_name
erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings
erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings
execute:frappe.delete_doc_if_exists("DocType", "Program Fee")

View File

@ -11,7 +11,7 @@ def execute():
for pos in frappe.get_all(doctype, filters={'disabled': 0}):
doc = frappe.get_doc(doctype, pos.name)
if not doc.user and doc.pos_profile_name: continue
if not doc.user or doc.pos_profile_name: continue
try:
doc.pos_profile_name = doc.user + ' - ' + doc.company

View File

@ -12,6 +12,7 @@ class StudentApplicant(Document):
def autoname(self):
from frappe.model.naming import set_name_by_naming_series
if self.student_admission:
naming_series = None
if self.program:
# set the naming series from the student admission if provided.
student_admission = get_student_admission_data(self.student_admission, self.program)

View File

@ -91,7 +91,7 @@ class Item(WebsiteGenerator):
self.validate_barcode()
self.cant_change()
self.validate_warehouse_for_reorder()
self.update_item_desc()
self.update_bom_item_desc()
self.synced_with_hub = 0
self.validate_has_variants()
@ -599,13 +599,27 @@ class Item(WebsiteGenerator):
row.label = label
row.description = desc
def update_item_desc(self):
if frappe.db.get_value('BOM',self.name, 'description') != self.description:
frappe.db.sql("""update `tabBOM` set description = %s where item = %s and docstatus < 2""",(self.description, self.name))
frappe.db.sql("""update `tabBOM Item` set description = %s where
item_code = %s and docstatus < 2""",(self.description, self.name))
frappe.db.sql("""update `tabBOM Explosion Item` set description = %s where
item_code = %s and docstatus < 2""",(self.description, self.name))
def update_bom_item_desc(self):
if self.is_new(): return
if self.db_get('description') != self.description:
frappe.db.sql("""
update `tabBOM`
set description = %s
where item = %s and docstatus < 2
""", (self.description, self.name))
frappe.db.sql("""
update `tabBOM Item`
set description = %s
where item_code = %s and docstatus < 2
""", (self.description, self.name))
frappe.db.sql("""
update `tabBOM Explosion Item`
set description = %s
where item_code = %s and docstatus < 2
""", (self.description, self.name))
def update_template_item(self):
"""Set Show in Website for Template Item if True for its Variant"""