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

@@ -40,15 +40,10 @@ class DocType(TransactionBase):
def validate_fiscal_year(self):
get_obj('Sales Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Posting Date')
# ******************* Get Customer Details ***********************
#def get_customer_details(self):
# sales_com_obj = get_obj('Sales Common')
# sales_com_obj.get_customer_details(self)
# sales_com_obj.get_shipping_details(self)
# ****** Get contact person details based on customer selected ****
def get_contact_details(self):
return cstr(get_obj('Sales Common').get_contact_details(self,0))
return get_obj('Sales Common').get_contact_details(self,0)
# *********** Get Commission rate of Sales Partner ****************
def get_comm_rate(self, sales_partner):
@@ -122,7 +117,7 @@ class DocType(TransactionBase):
ret = {
'actual_qty' : actual_qty and flt(actual_qty[0]['actual_qty']) or 0
}
return cstr(ret)
return ret
# OTHER CHARGES TRIGGER FUNCTIONS

View File

@@ -27,7 +27,7 @@ class DocType:
ret = {
'tax_rate' : rate and flt(rate[0][0]) or 0
}
return str(ret)
return ret
def on_update(self):
bin = sql("select stock_uom from `tabBin` where item_code = '%s' " % self.doc.item_code)

View File

@@ -42,18 +42,15 @@ class DocType(TransactionBase):
#-----------------Validation For Fiscal Year------------------------
def validate_fiscal_year(self):
get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.transaction_date,'Transaction Date')
# Get Supplier Details
#def get_supplier_details(self, name = ''):
# return cstr(get_obj(dt='Purchase Common').get_supplier_details(name))
# 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
# =====================================================================================
@@ -62,7 +59,7 @@ class DocType(TransactionBase):
# get available qty at warehouse
def get_bin_details(self, arg = ''):
return cstr(get_obj(dt='Purchase Common').get_bin_details(arg))
return get_obj(dt='Purchase Common').get_bin_details(arg)f
# Pull Purchase Order
def get_po_details(self):

View File

@@ -38,7 +38,7 @@ class DocType:
def get_item_details(self, name):
det = sql("select description, stock_uom from `tabItem` where name = '%s' " % cstr(name))
rate = sql("select ref_rate from `tabRef Rate Detail` where price_list_name = %s and parent = %s and ref_currency = %s", (self.doc.price_list, name, self.doc.currency))
return cstr({'description' : det and det[0][0] or '', 'uom': det and det[0][1] or '', 'rate': rate and flt(rate[0][0]) or 0.00})
return {'description' : det and det[0][0] or '', 'uom': det and det[0][1] or '', 'rate': rate and flt(rate[0][0]) or 0.00}
def get_main_item(self):

View File

@@ -54,7 +54,7 @@ class DocType:
'conversion_factor' : 1,
'batch_no' : ''
}
return str(ret)
return ret
# Get UOM Details
@@ -70,7 +70,7 @@ class DocType:
'conversion_factor' : flt(uom[0]['conversion_factor']),
'transfer_qty' : flt(arg['qty']) * flt(uom[0]['conversion_factor']),
}
return str(ret)
return ret
# get stock and incoming rate on posting date
@@ -396,7 +396,7 @@ class DocType:
'customer_name' : res and res[0][1] or '',
'customer_address' : res and res[0][2] or ''}
return str(ret)
return ret
def get_cust_addr(self):
@@ -405,7 +405,7 @@ class DocType:
'customer_name' : res and res[0][0] or '',
'customer_address' : res and res[0][1] or ''}
return str(ret)
return ret
@@ -415,7 +415,7 @@ class DocType:
'supplier' : res and res[0][0] or '',
'supplier_name' :res and res[0][1] or '',
'supplier_address' : res and res[0][2] or ''}
return str(ret)
return ret
def get_supp_addr(self):
@@ -423,4 +423,4 @@ class DocType:
ret = {
'supplier_name' : res and res[0][0] or '',
'supplier_address' : res and res[0][1] or ''}
return str(ret)
return ret

View File

@@ -22,7 +22,7 @@ class DocType:
self.doc, self.doclist = d,dl
def get_stock_uom(self, item_code):
return cstr({'current_stock_uom': cstr(get_value('Item', item_code, 'stock_uom'))})
return {'current_stock_uom': cstr(get_value('Item', item_code, 'stock_uom'))}
def validate_mandatory(self):
if not cstr(self.doc.item_code):