From d075a6c53dc2c832a363409cd4b32ff5a6482e5a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 17 Aug 2011 10:50:57 +0530 Subject: [PATCH] Removed cstr in return for get_server_fields() --- accounts/doctype/account/account.py | 2 +- accounts/doctype/form_16a/form_16a.py | 2 +- accounts/doctype/payable_voucher/payable_voucher.py | 2 +- buying/doctype/indent/indent.py | 4 ++-- hr/doctype/leave_application/leave_application.py | 4 ++-- production/doctype/bill_of_materials/bill_of_materials.py | 2 +- production/doctype/production_order/production_order.py | 2 +- projects/doctype/project/project.py | 2 +- setup/doctype/workflow_rule/workflow_rule.py | 2 +- stock/doctype/item/item.py | 2 +- .../doctype/file_browser_control/file_browser_control.py | 6 +++--- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/accounts/doctype/account/account.py b/accounts/doctype/account/account.py index 52c66a9adf..6c8003a581 100644 --- a/accounts/doctype/account/account.py +++ b/accounts/doctype/account/account.py @@ -31,7 +31,7 @@ class DocType: def get_address(self): add=sql("Select address from `tab%s` where name='%s'"%(self.doc.master_type,self.doc.master_name)) ret={'address':add[0][0]} - return cstr(ret) + return ret # check whether master name entered for supplier/customer diff --git a/accounts/doctype/form_16a/form_16a.py b/accounts/doctype/form_16a/form_16a.py index 0bcef6b7a6..018b834763 100644 --- a/accounts/doctype/form_16a/form_16a.py +++ b/accounts/doctype/form_16a/form_16a.py @@ -56,7 +56,7 @@ class DocType(TransactionBase): 'party_address': cstr(address_display) } - return cstr(ret) + return ret # Get TDS Return acknowledgement #------------------------------- diff --git a/accounts/doctype/payable_voucher/payable_voucher.py b/accounts/doctype/payable_voucher/payable_voucher.py index e88066a176..d7f628f459 100644 --- a/accounts/doctype/payable_voucher/payable_voucher.py +++ b/accounts/doctype/payable_voucher/payable_voucher.py @@ -345,7 +345,7 @@ class DocType(TransactionBase): # get tds rate # ------------- def get_tds_rate(self): - return str({'rate' : flt(get_value('Account', self.doc.tax_code, 'tax_rate'))}) + return {'rate' : flt(get_value('Account', self.doc.tax_code, 'tax_rate'))} # set aging date #------------------- diff --git a/buying/doctype/indent/indent.py b/buying/doctype/indent/indent.py index 450ea641ea..882098f238 100644 --- a/buying/doctype/indent/indent.py +++ b/buying/doctype/indent/indent.py @@ -90,12 +90,12 @@ class DocType: # get item details # --------------------------------- def get_item_details(self, arg =''): - return cstr( get_obj(dt='Purchase Common').get_item_details(self,arg) ) + return get_obj(dt='Purchase Common').get_item_details(self,arg) # Get UOM Details # --------------------------------- def get_uom_details(self, arg = ''): - return cstr(get_obj(dt='Purchase Common').get_uom_details(arg)) + return get_obj(dt='Purchase Common').get_uom_details(arg) # GET TERMS & CONDITIONS #----------------------------- diff --git a/hr/doctype/leave_application/leave_application.py b/hr/doctype/leave_application/leave_application.py index 5f69c63a19..01bf7fec50 100755 --- a/hr/doctype/leave_application/leave_application.py +++ b/hr/doctype/leave_application/leave_application.py @@ -33,7 +33,7 @@ class DocType: leave_app = sql("select total_leave_days from `tabLeave Application` where employee = '%s' and leave_type = '%s' and fiscal_year = '%s' and docstatus = 1" % (self.doc.employee, self.doc.leave_type, self.doc.fiscal_year)) leave_app = leave_app and flt(leave_app[0][0]) or 0 ret = {'leave_balance':leave_all - leave_app} - return str(ret) + return ret # ************************************************ utilities ************************************************* @@ -55,7 +55,7 @@ class DocType: tot_days = date_diff(self.doc.to_date, self.doc.from_date) + 1 holidays = self.get_holidays() ret = {'total_leave_days':flt(tot_days)-flt(holidays)} - return str(ret) + return ret # ************************************************ validate ************************************************* diff --git a/production/doctype/bill_of_materials/bill_of_materials.py b/production/doctype/bill_of_materials/bill_of_materials.py index d7d3db5f6b..d287d2f9d5 100644 --- a/production/doctype/bill_of_materials/bill_of_materials.py +++ b/production/doctype/bill_of_materials/bill_of_materials.py @@ -106,7 +106,7 @@ class DocType: 'standard_rate' : 0 } ret_item.update(ret_bom_rates) - return cstr(ret_item) + return ret_item def set_as_default_bom(self): # set Is Default as 1 diff --git a/production/doctype/production_order/production_order.py b/production/doctype/production_order/production_order.py index ce8f0828bb..570c802666 100644 --- a/production/doctype/production_order/production_order.py +++ b/production/doctype/production_order/production_order.py @@ -34,7 +34,7 @@ class DocType: 'stock_uom' : item and item[0]['stock_uom'] or '', 'default_bom' : item and item[0]['default_bom'] or '' } - return cstr(ret) + return ret def validate(self): if not self.doc.production_item : diff --git a/projects/doctype/project/project.py b/projects/doctype/project/project.py index 084df6c04b..9930bf4213 100644 --- a/projects/doctype/project/project.py +++ b/projects/doctype/project/project.py @@ -52,7 +52,7 @@ class DocType: 'contact_no' : contact and contact[0]['contact_no'] or '', 'email_id' : contact and contact[0]['email_id'] or '' } - return str(ret) + return ret else: msgprint("Contact Person : %s does not exist in the system." % (self.doc,contact_person)) raise Exception diff --git a/setup/doctype/workflow_rule/workflow_rule.py b/setup/doctype/workflow_rule/workflow_rule.py index 3a8cc82186..792cbf0090 100644 --- a/setup/doctype/workflow_rule/workflow_rule.py +++ b/setup/doctype/workflow_rule/workflow_rule.py @@ -281,4 +281,4 @@ class DocType: elif cond_hold =='Yes': all_cond_hold ='Yes' - return all_cond_hold \ No newline at end of file + return all_cond_hold diff --git a/stock/doctype/item/item.py b/stock/doctype/item/item.py index d51fb3a081..b506541596 100644 --- a/stock/doctype/item/item.py +++ b/stock/doctype/item/item.py @@ -169,7 +169,7 @@ Total Available Qty: %s 'description' : file and file[0]['description'] or '' } - return str(ret) + return ret def check_if_sle_exists(self): """ diff --git a/utilities/doctype/file_browser_control/file_browser_control.py b/utilities/doctype/file_browser_control/file_browser_control.py index 8008ae9877..d5ad0cccfa 100644 --- a/utilities/doctype/file_browser_control/file_browser_control.py +++ b/utilities/doctype/file_browser_control/file_browser_control.py @@ -69,7 +69,7 @@ class DocType: 'name' : f_obj.doc.name, 'label' : f_obj.doc.file_name } - return cstr(ret) + return ret # Update changes done to selected file group. def update_grp(self,arg): @@ -160,7 +160,7 @@ class DocType: 'file_name' : f.file_name } - return cstr(ret) + return ret else: return 'No file found.' else: @@ -195,4 +195,4 @@ class DocType: def get_privileges(self,arg): arg = eval(arg) privilege = convert_to_lists(sql("select ifnull(can_edit,''), ifnull(can_view,''),owner from `tab%s` where name='%s'" % (arg['dt'],arg['dn']))) - return privilege \ No newline at end of file + return privilege