fixed get_server_values to make them utf-8 friendly

This commit is contained in:
Rushabh Mehta
2011-08-12 10:55:43 +05:30
parent b3453e6ed5
commit 89717292b7
36 changed files with 95 additions and 195 deletions

View File

@@ -38,7 +38,7 @@ class DocType:
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)
return ret
else:
msgprint("Customer : %s does not exist in system." % (self.doc.customer))
raise Exception
@@ -65,7 +65,7 @@ class DocType:
#if pft > 0:
per_pft = (flt(pft) / flt(self.doc.project_value)) * 100
ret = {'gross_margin_value': pft, 'per_gross_margin': per_pft}
return cstr(ret)
return ret
# validate
#================================================

View File

@@ -22,18 +22,18 @@ class DocType:
cust = sql("select customer, customer_name from `tabProject` where name = %s", self.doc.project)
if cust:
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
return cstr(ret)
return ret
def get_customer_details(self):
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
if cust:
ret = {'customer_name': cust and cust[0][0] or ''}
return cstr(ret)
return ret
def get_allocated_to_name(self):
as_em = sql("select first_name, last_name from `tabProfile` where name=%s",self.doc.allocated_to)
ret = { 'allocated_to_name' : as_em and (as_em[0][0] + ' ' + as_em[0][1]) or ''}
return cstr(ret)
return ret
# validate
#--------------------------------------------

View File

@@ -32,7 +32,7 @@ class DocType:
tsk = sql("select name, project, customer, customer_name from `tabTicket` where subject = %s", task_sub)
if tsk:
ret = {'task_id': tsk and tsk[0][0] or '', 'project_name': tsk and tsk[0][1] or '', 'customer_name': tsk and tsk[0][3] or ''}
return cstr(ret)
return ret
def validate(self):
if getdate(self.doc.timesheet_date) > getdate(nowdate()):