Corrections on account_report

bzr revid: jvo@tinyerp.com-20090116122256-g51dv4jx9xqdl7ho
This commit is contained in:
Jay (Open ERP)
2009-01-16 17:52:56 +05:30
parent 232797ffe2
commit 444433cf66
2 changed files with 22 additions and 25 deletions
+17 -11
View File
@@ -92,22 +92,25 @@ class accounting_report_indicator(report_sxw.rml_parse):
'getarray':self.getarray,
'gettree':self.gettree,
})
self.count=0
self.treecount=0
self.list=[]
self.header_name=self.header_val=[]
self.main_dict={}
self.count = 0
self.treecount = 0
self.list = []
self.header_name = []
self.header_val = []
self.main_dict = {}
def repeatIn(self, lst, name, nodes_parent=False,td=False,width=[],value=[],type=[]):
def repeatIn(self, lst, name, nodes_parent=False,td=False,width=[],value=[],type=[],data=''):
self._node.data = ''
node = self._find_parent(self._node, nodes_parent or parents)
ns = node.nextSibling
#start
if not name=='array':
return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False)
value=['Data']
array_header = eval(data,{'year':'Fiscal Year','periods':'Periods'})
value = [array_header]
value.extend(self.header_name)
type=['string'].extend(['float']*len(self.header_name))
width=[40]*(len(self.header_name)+1)
@@ -145,7 +148,6 @@ class accounting_report_indicator(report_sxw.rml_parse):
newnode=False
i+=1
check=1
return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False)
def lines(self,data):
@@ -173,18 +175,22 @@ class accounting_report_indicator(report_sxw.rml_parse):
'disp_tree':obj_ind.disp_tree,
'note':obj_ind.note,
'type':obj_ind.type,
'array_table' : False,
}
if len(obj_ind.expression)>=2:
res['array_table'] = True
result.append(res)
return result
def getarray(self,data,object):
def getarray(self,data,object,array_header=''):
res={}
result=[]
self.getgraph(data,object,intercall=True)
self.header_val=[str(x) for x in self.header_val]
temp_dict=zip(self.header_name,self.header_val)
res=dict(temp_dict)
res['Data']='Value'
array_header = eval(array_header,{'year':'Fiscal Year','periods':'Periods'})
res[array_header]='Value'
result.append(res)
return result
@@ -91,14 +91,11 @@
<font color="white"> </font>
</para>
<para style="P1">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
<blockTable colWidths="362.0,166.0" style="Table4">
<blockTable colWidths="528.0" style="Table4">
<tr>
<td>
<para style="P6">Name</para>
</td>
<td>
<para style="P6">Code</para>
</td>
</tr>
</blockTable>
<para style="P3">
@@ -107,26 +104,20 @@
<para style="P3"><seqReset/></para>
<section>
<para style="P1">[[ repeatIn(lines(data['form']),'o')]]</para>
<blockTable colWidths="362.0,166.0" style="Table3">
<blockTable colWidths="528.0" style="Table3">
<tr>
<td>
<para style="P11"><b>(<seq/>)</b> [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['name'] ]]</u></para>
</td>
<td>
<para style="P11">[[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['code'] ]]</u></para>
<para style="P11"><b>(<seq/>)</b> [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]<u>[[ o['name'] ]]</u> (<u>[[ o['code'] ]]</u>)</para>
</td>
</tr>
</blockTable>
<para style="P3">
<font color="white"> </font>
</para>
<para style="P1">[[ o['disp_tree'] and setTag('para','image',{'file':gettree(data['form'],o)}) or removeParentNode('para') ]]</para>
<para style="P1">[[ o['disp_graph'] and setTag('para','image',{'width':'450.00','height':'215.00','file':getgraph(data['form'],o)}) or removeParentNode('para') ]]</para>
<para style="P3">
<font color="white"> </font>
</para>
<section>
<para style="P13">[[ repeatIn(getarray(data['form'],o),'array',td=len(data['form']['base_selection'][0][2])) ]]</para>
<para style="P13">[[ o['array_table'] and repeatIn(getarray(data['form'],o,array_header=data['form']['select_base']),'array',td=len(data['form']['base_selection'][0][2]),data=data['form']['select_base']) or removeParentNode('section') ]]</para>
<blockTable colWidths="0.0" style="Table5">
<tr>
<td>
@@ -165,7 +156,7 @@
<para style="P9"> </para>
</td>
<td>
<para style="P5"><b>Notes :</b> [[ o['note'] ]]</para>
<para style="P5"> [[ format(o['note']) or removeParentNode('blockTable') ]]</para>
</td>
<td>
<para style="P9"> </para>