mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 12:39:18 +00:00
fixed get_server_values to make them utf-8 friendly
This commit is contained in:
@@ -27,37 +27,6 @@ class DocType(TransactionBase):
|
||||
def autoname(self):
|
||||
#self.doc.name = make_autoname('CI/' + self.doc.fiscal_year + '/.######')
|
||||
self.doc.name = make_autoname(self.doc.naming_series + '.######')
|
||||
|
||||
#def get_customer_details(self):
|
||||
# details = sql("select address, territory, customer_group, customer_name from `tabCustomer` where name = '%s' and docstatus != 2" %(self.doc.customer), as_dict = 1)
|
||||
# if details:
|
||||
# ret = {
|
||||
# 'customer_address' : details and details[0]['address'] or '',
|
||||
# 'customer_name' : details and details[0]['customer_name'] or '',
|
||||
# 'territory' : details and details[0]['territory'] or '',
|
||||
# 'customer_group' : details and details[0]['customer_group'] or ''
|
||||
# }
|
||||
# # ********** get primary contact details (this is done separately coz. , in case there is no primary contact thn it would not be able to fetch customer details in case of join query)
|
||||
# contact_det = sql("select contact_name, contact_no, email_id from `tabContact` where customer_name = '%s' and is_customer = 1 and is_primary_contact = 'Yes' and docstatus != 2" %(self.doc.customer), as_dict = 1)
|
||||
# ret['contact_person'] = contact_det and contact_det[0]['contact_name'] or ''
|
||||
# ret['contact_no'] = contact_det and contact_det[0]['contact_no'] or ''
|
||||
# ret['email_id'] = contact_det and contact_det[0]['email_id'] or ''
|
||||
#
|
||||
# return cstr(ret)
|
||||
# else:
|
||||
# msgprint("Customer : %s does not exist in system." % (name))
|
||||
# raise Exception
|
||||
|
||||
# Get customer's contact person details
|
||||
# ==============================================================
|
||||
#def get_contact_details(self):
|
||||
# contact = sql("select contact_no, email_id from `tabContact` where contact_name = '%s' and customer_name = '%s' and docstatus != 2" %(self.doc.contact_person, self.doc.customer), as_dict = 1)
|
||||
# ret = {
|
||||
# 'contact_no' : contact and contact[0]['contact_no'] or '',
|
||||
# 'email_id' : contact and contact[0]['email_id'] or ''
|
||||
# }
|
||||
# return str(ret)
|
||||
|
||||
|
||||
#check if maintenance schedule already generated
|
||||
#============================================
|
||||
@@ -66,7 +35,7 @@ class DocType(TransactionBase):
|
||||
nm = nm and nm[0][0] or ''
|
||||
|
||||
if not nm:
|
||||
return cstr('No')
|
||||
return 'No'
|
||||
|
||||
def on_submit(self):
|
||||
if session['user'] != 'Guest':
|
||||
|
||||
@@ -38,21 +38,8 @@ class DocType(TransactionBase):
|
||||
'item_name': item and item[0]['item_name'] or '',
|
||||
'description' : item and item[0]['description'] or ''
|
||||
}
|
||||
return str(ret)
|
||||
|
||||
#pull customer details
|
||||
#-------------------------
|
||||
#def get_customer_details(self):
|
||||
# det = sql("select t1.customer_name,t1.address,t1.territory,t2.contact_name from `tabCustomer` t1, `tabContact` t2 where t1.name = %s and t1.name=t2.customer and t2.is_primary_contact = 'Yes'", self.doc.customer, as_dict=1)
|
||||
#
|
||||
# ret = {
|
||||
# 'customer_name': det and det[0]['customer_name'] or '',
|
||||
# 'address' : det and det[0]['address'] or '',
|
||||
# 'territory': det and det[0]['territory'] or '',
|
||||
# 'contact_person' : det and det[0]['contact_name'] or ''
|
||||
# }
|
||||
# return str(ret)
|
||||
|
||||
return ret
|
||||
|
||||
# generate maintenance schedule
|
||||
#-------------------------------------
|
||||
def generate_schedule(self):
|
||||
@@ -132,7 +119,7 @@ class DocType(TransactionBase):
|
||||
count = period/365
|
||||
|
||||
ret = {'no_of_visits':count}
|
||||
return str(ret)
|
||||
return ret
|
||||
|
||||
def validate_maintenance_detail(self):
|
||||
if not getlist(self.doclist, 'item_maintenance_detail'):
|
||||
|
||||
@@ -31,20 +31,7 @@ class DocType(TransactionBase):
|
||||
'item_name' : item and item[0]['item_name'] or '',
|
||||
'description' : item and item[0]['description'] or ''
|
||||
}
|
||||
return str(ret)
|
||||
|
||||
#get customer details
|
||||
#-----------------------
|
||||
#def get_customer_details(self):
|
||||
# det = sql("select t1.customer_name,t1.address,t1.territory,t2.contact_name from `tabCustomer` t1, `tabContact` t2 where t1.name = %s and t1.name=t2.customer and t2.is_primary_contact = 'Yes'", self.doc.customer, as_dict=1)
|
||||
#
|
||||
# ret = {
|
||||
# 'customer_name' : det and det[0]['customer_name'] or '',
|
||||
# 'address' : det and det[0]['address'] or '',
|
||||
# 'territory': det and det[0]['territory'] or '',
|
||||
# 'contact_person' : det and det[0]['contact_name'] or ''
|
||||
# }
|
||||
# return str(ret)
|
||||
return ret
|
||||
|
||||
# fetch details of resp Sales order or customer issue
|
||||
#-----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user