Merged with upstream master

This commit is contained in:
Brahma K
2011-08-16 12:27:48 +05:30
65 changed files with 1294 additions and 1207 deletions

View File

@@ -36,7 +36,7 @@ class DocType:
ret={
'description' : item and item[0]['description'] or ''
}
return cstr(ret)
return ret
def get_workstation_details(self,workstation):
ws = sql("select hour_rate, capacity from `tabWorkstation` where name = %s",workstation , as_dict = 1)
@@ -44,7 +44,7 @@ class DocType:
'hour_rate' : ws and flt(ws[0]['hour_rate']) or '',
'workstation_capacity' : ws and flt(ws[0]['capacity']) or ''
}
return cstr(ret)
return ret
def get_bom_material_detail(self, arg):
arg = eval(arg)
@@ -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

View File

@@ -32,7 +32,7 @@ class DocType:
'stock_uom' : item and item[0]['stock_uom'],
'bom_no' : item and item[0]['default_bom']
}
return cstr(ret)
return ret
else:
msgprint("Item %s does not exist in system." %(args['item_code']))
raise Exception

View File

@@ -25,7 +25,7 @@ class DocType:
def update_bom_operation(self):
bom_list = sql(" select DISTINCT parent from `tabBOM Operation` where workstation = '%s'" % self.doc.name)
for bom_no in bom_list:
sql("update `tabBOM Operation` set hour_rate = '%s' where parent = '%s' and workstation = '%s'"%( self.doc.hour_rate, bom_no, self.doc.name))
sql("update `tabBOM Operation` set hour_rate = '%s' where parent = '%s' and workstation = '%s'"%( self.doc.hour_rate, bom_no[0], self.doc.name))
def on_update(self):
set(self.doc, 'overhead', flt(self.doc.hour_rate_electricity) + flt(self.doc.hour_rate_consumable) + flt(self.doc.hour_rate_rent))