del context['fiscalyear']
acc = self.pool.get('account.account')
acc_id = acc.search(cr, uid, [('code','in',code)])
- return reduce(lambda y,x=0: x.credit+y, acc.browse(cr, uid, acc_id, context),0)
+ return reduce(lambda y,x=0: x.credit+y, acc.browse(cr, uid, acc_id, context),0.0)
def _calc_debit(code,year=0):
context['fiscalyear']=_calc_context(year,obj_fy)
del context['fiscalyear']
acc = self.pool.get('account.account')
acc_id = acc.search(cr, uid, [('code','in',code)])
- return reduce(lambda y,x=0: x.debit+y, acc.browse(cr, uid, acc_id, context),0)
+ return reduce(lambda y,x=0: x.debit+y, acc.browse(cr, uid, acc_id, context),0.0)
def _calc_balance(code,year=0):
context['fiscalyear']=_calc_context(year,obj_fy)
del context['fiscalyear']
acc = self.pool.get('account.account')
acc_id = acc.search(cr, uid, [('code','in',code)])
- return reduce(lambda y,x=0: x.balance+y, acc.browse(cr, uid, acc_id, context),0)
+ return reduce(lambda y,x=0: x.balance+y, acc.browse(cr, uid, acc_id, context),0.0)
def _calc_report(*code):
acc = self.pool.get('account.report.report')
acc_id = acc.search(cr, uid, [('code','in',code)])
- return reduce(lambda y,x=0: x.amount+y, acc.browse(cr, uid, acc_id, context),0)
+ return reduce(lambda y,x=0: x.amount+y, acc.browse(cr, uid, acc_id, context),0.0)
def _calc_tax_code(code,period=0):
context['period_id']=_calc_context(period,obj_period)
context['period_id']=context['period_id'][0]
acc = self.pool.get('account.tax.code')
acc_id = acc.search(cr, uid, [('code','in',code)])
- return reduce(lambda y,x=0: x.sum_period+y, acc.browse(cr, uid, acc_id, context),0)
+ return reduce(lambda y,x=0: x.sum_period+y, acc.browse(cr, uid, acc_id, context),0.0)
result = {}
for rep in self.browse(cr, uid, ids, context):
objdict = {
level=0
self.level=0
self.child_dist=0
- def draw_tree2(obj_history,base_x,base_y,level=0,i=0):
+
+ def draw_tree(obj_history,base_x,base_y,level=0,i=0):
self.line_y=base_y
if obj_history.child_ids:
if self.child_dist:
i=0
for child in obj_history.child_ids:
- draw_tree2(child,base_x+(100),base_y,level,i)
+ draw_tree(child,base_x+(100),base_y,level,i)
i+=1
child_dist=len(obj_history.child_ids)
else:
base_y=base_y-(50*(i))
- tb12 = text_box.T(loc=(base_x,base_y), text=str(obj_history.code))
+ tb12 = text_box.T(loc=(base_x,base_y), text="/hC"+str(obj_history.code)+":\n"+str(obj_history.amount))
tb12.draw()
if i>0:
a.draw([(base_x-30,base_y), (base_x,base_y)])
self.level=base_y
self.line_y=900
- draw_tree2(obj_history,0,900,0)
+ draw_tree(obj_history,0,900,0)
can.close()
os.system('cp '+'tree_image'+str(self.treecount)+'.png ' +path+str(self.treecount)+'.png')