From f84060ca4f6bb50772e80c8e99d8ab828cf4c452 Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Mon, 1 Jun 2009 18:15:30 +0530 Subject: [PATCH 2/6] Improved reports bzr revid: nch@tinyerp.com-20090601124530-e2d8qxykl9gsd22a --- addons/stock/report/lot_location.rml | 35 +++------- addons/stock/report/lot_overview.rml | 44 +++--------- addons/stock/report/lot_overview_all.rml | 88 +++++++----------------- 3 files changed, 46 insertions(+), 121 deletions(-) diff --git a/addons/stock/report/lot_location.rml b/addons/stock/report/lot_location.rml index a075637955f..94cc3f51340 100644 --- a/addons/stock/report/lot_location.rml +++ b/addons/stock/report/lot_location.rml @@ -49,6 +49,7 @@ + @@ -60,20 +61,19 @@
- - - Location - Product - Quantity - - - [[ repeatIn(objects,'o') ]] + [[ repeatIn(objects,'o') ]]
- [[ repeatIn(process(o.id),'ob') ]] + [[ repeatIn(process(o.id),'ob') ]] + + [[ ob['product'] or removeParentNode('blockTable') ]] Location + Product + Quantity + + [[ ob['location_name'] ]] - [[ ob['product'] or 'No products in this Location !' ]] + @@ -83,27 +83,14 @@ [[ p['prod_qty'] ]] [[ p['uom'] ]] - - Total : [[ ob['total'] ]] Units - - - - - - - - - - - - +
diff --git a/addons/stock/report/lot_overview.rml b/addons/stock/report/lot_overview.rml index 65c48fa43c1..ad05b011757 100644 --- a/addons/stock/report/lot_overview.rml +++ b/addons/stock/report/lot_overview.rml @@ -10,11 +10,6 @@ - - - - - @@ -24,18 +19,7 @@ - - - - - - - - - - - - + @@ -57,6 +41,7 @@ + @@ -69,9 +54,12 @@
- + [[ repeatIn(objects,'o') ]] +
+ [[ repeatIn(process(o.id),'ob') ]] + - Location + [[ ob['product'] or removeParentNode('blockTable') ]] Location Product Variants Quantity @@ -79,14 +67,9 @@ Unit Price Value - - [[ repeatIn(objects,'o') ]] -
- [[ repeatIn(process(o.id),'ob') ]] - [[ ob['location_name'] ]] - [[ ob['product'] or 'No products in this Location !' ]] + @@ -94,7 +77,7 @@ - [[ repeatIn(ob['product'],'p') ]] + [[ repeatIn(ob['product'],'p') ]] [[ p['prod_name'] ]] [[ p['variants'] ]] [[ p['prod_qty'] ]] @@ -102,9 +85,7 @@ [[ p['price'] ]] [[ p['price_value'] ]] - - - + Total: @@ -115,9 +96,6 @@ - - -
@@ -128,7 +106,7 @@ - [[ grand_total_price() ]] + [[ grand_total_price() ]] diff --git a/addons/stock/report/lot_overview_all.rml b/addons/stock/report/lot_overview_all.rml index e848ba89f6a..0df08385c9a 100644 --- a/addons/stock/report/lot_overview_all.rml +++ b/addons/stock/report/lot_overview_all.rml @@ -10,45 +10,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -68,6 +39,7 @@ + @@ -80,13 +52,13 @@ - - -
- - - Location + [[ repeatIn(objects,'o') ]] +
+ [[ repeatIn(process(o.id),'ob') ]] + + + [[ ob['product'] or removeParentNode('blockTable') ]] Location Code Product Variants @@ -94,16 +66,11 @@ UoM UnitPrice Value - - - [[repeatIn(objects,'o')]] -
- [[ repeatIn(process(o.id),'ob') ]] - + [[ ob['location_name'] ]] - [[ ob['product'] or 'No products in this Location' ]] + @@ -120,36 +87,29 @@ [[ p['price'] ]] [[ p['price_value'] ]] - - - - - - - + + Total: - - - - - + + + + + [[ price_total() ]] - -
Grand Total: - - - - - - - [[ grand_total_price() ]] + + + + + + + [[ grand_total_price() ]] From 86c603f349adb8906ec40353f33be103ab185332 Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Tue, 2 Jun 2009 11:37:12 +0530 Subject: [PATCH 3/6] improved reports bzr revid: nch@tinyerp.com-20090602060712-ycxmaf2kffk0gchx --- addons/auction/report/catelogwithpictures.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auction/report/catelogwithpictures.rml b/addons/auction/report/catelogwithpictures.rml index f666a60575d..b3a772b4940 100644 --- a/addons/auction/report/catelogwithpictures.rml +++ b/addons/auction/report/catelogwithpictures.rml @@ -82,7 +82,7 @@ - [[ setTag('para','image',{'width':'100.0','height':'80.0','name':str(o.id)}) ]][[ o.image or setTag('image','para') ]] + [[ o.image and setTag('para','image',{'width':'100.0','height':'80.0','name':str(o.id)}) ]][[ o.image ]] From eb180d6b1f92f06121da21744b366201d82afd3d Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Tue, 2 Jun 2009 19:17:59 +0530 Subject: [PATCH 4/6] changed report indicator of account_report bzr revid: nch@tinyerp.com-20090602134759-8f165yz18093nfky --- .../account_report/report/print_indicator.py | 85 +++------- .../account_report/report/print_indicator.rml | 158 +++++++++--------- 2 files changed, 97 insertions(+), 146 deletions(-) diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py index d7bd70f40e4..9d4fa4673f4 100644 --- a/addons/account_report/report/print_indicator.py +++ b/addons/account_report/report/print_indicator.py @@ -73,13 +73,6 @@ import tools import os -parents = { - 'tr':1, - 'li':1, - 'story': 0, - 'section': 0 -} - class accounting_report_indicator(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): @@ -91,6 +84,7 @@ class accounting_report_indicator(report_sxw.rml_parse): 'lines':self.lines, 'getarray':self.getarray, 'gettree':self.gettree, + 'getarray_head':self.getarray_head, }) self.count = 0 self.treecount = 0 @@ -98,61 +92,8 @@ class accounting_report_indicator(report_sxw.rml_parse): self.header_name = [] self.header_val = [] self.main_dict = {} - - 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 in ['array','array_header']): - return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False) - - array_header = eval(data,{'year':'Fiscal Year','periods':'Periods'}) -# value = [array_header] - value = [] - value.extend(self.header_name) - if name=='array': - type = ['float']*len(self.header_name) - else: - type = ['lable'] * (len(self.header_name)) - - width = [438/float(len(value))]*(len(value)) - - if not lst: - lst.append(1) - for ns in node.childNodes : - if ns and ns.nodeName!='#text' and ns.tagName=='blockTable' and td : - width_str = ns._attrs['colWidths'].nodeValue - ns.removeAttribute('colWidths') -# total_td = td * len(value) - - if not width: - for v in value: - width.append(30) - for v in range(len(width)): - width_str +=',%d'%width[v] - - ns.setAttribute('colWidths',width_str) - - child_list = ns.childNodes - for child in child_list: - if child.nodeName=='tr': - lc = child.childNodes[1] - i=0 - for v in value: - newnode = lc.cloneNode(1) - if type[i] == 'float': - t1="[[ '%.2f' % " + "%s['%s'] ]]"%(name,v) - if type[i] == 'lable': - t1="%s"%(v) - else: - t1="[[ %s['%s'] ]]"%(name,v) - newnode.childNodes[1].lastChild.data = t1 - child.appendChild(newnode) - newnode=False - i+=1 - return super(accounting_report_indicator,self).repeatIn(lst, name, nodes_parent=False) +# def lines(self,data): res={} @@ -193,12 +134,30 @@ class accounting_report_indicator(report_sxw.rml_parse): result.append(res) return result + def getarray_head(self,data,object,array_header=''): + self.getgraph(data,object,intercall=True) + self.header_val=[str(x) for x in self.header_val] + if data['select_base'] == 'year': + year = [1,2,3,4,5,6,7,8] + temp_head = [str(x) for x in self.header_name] + head_dict = dict(zip(year,temp_head)) + else: + temp_head = [str(x[0:3]) for x in self.header_name] + head_dict = dict(zip(temp_head,temp_head)) + print "head_dict",head_dict + return [head_dict] + 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) + self.header_val = [str(x) for x in self.header_val] + if data['select_base'] == 'year': + year = [1,2,3,4,5,6,7,8] + temp_dict = zip(year,self.header_val) + else: + temp_head = [str(x[0:3]) for x in self.header_name] + temp_dict = zip(temp_head,self.header_val) res=dict(temp_dict) array_header = eval(array_header,{'year':'Fiscal Year','periods':'Periods'}) res[array_header]=object['name'] diff --git a/addons/account_report/report/print_indicator.rml b/addons/account_report/report/print_indicator.rml index 0015324ecbe..f7277115529 100644 --- a/addons/account_report/report/print_indicator.rml +++ b/addons/account_report/report/print_indicator.rml @@ -81,101 +81,93 @@ - + - - Indicators - + Indicators - - + + + + [[ company.name ]] + Currency: [[ company.currency_id.name]] + + + + Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + - [[ company.name ]] - - - Currency: [[ company.currency_id.name]] - - + Name - - - - -Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - - - -Name - - - - - - - -
-[[ repeatIn(lines(data['form']),'o')]] - - - -[['.....'*(o['level']) ]][[ setTag('font','font',{'color':'white'}) ]]() [[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]][[ o['name'] ]] ([[ o['code'] ]]) - - - -[[ o['disp_tree'] and setTag('para','image',{'file':gettree(data['form'],o)}) or removeParentNode('para') ]] -[[ o['disp_graph'] and setTag('para','image',{'width':'450.00','height':'215.00','file':getgraph(data['form'],o)}) or removeParentNode('para') ]] - - - - - -[['..........'*(o['level']) ]][[ setTag('font','font',{'color':'white'}) ]]Expression : [[ o['expression'] ]] - - - - - - - [['..........'*(o['level']) ]][[ setTag('font','font',{'color':'white'}) ]] [[ format(o['note']) or removeParentNode('blockTable') ]] - - - -
- - -Tabular Summary - -
- [[ repeatIn(getarray(data['form'],o,array_header=data['form']['select_base']),'array_header',td=len(data['form']['base_selection'][0][2]),data=data['form']['select_base']) or removeParentNode('section') ]] - + + + +
+ [[ repeatIn(lines(data['form']),'o')]] + + + [['.....'*(o['level']) ]][[ o['type']=='view' and setTag('para','para',{'fontName':'Helvetica-Bold','fontSize':'10.5'}) ]]()[[ o['name'] ]] ([[ o['code'] ]]) + + + [[ o['disp_tree'] and setTag('para','image',{'file':gettree(data['form'],o)}) or removeParentNode('para') ]] + [[ o['disp_graph'] and setTag('para','image',{'width':'450.00','height':'215.00','file':getgraph(data['form'],o)}) or removeParentNode('para') ]] + + + + [['..........' *(o['level']) ]]Expression :[[ o['expression'] ]] + + + + + [['..........'*(o['level']) ]] [[ format(o['note']) or removeParentNode('blockTable') ]] + + +
+ + Tabular Summary +
+ [[ repeatIn(getarray_head(data['form'],o,array_header=data['form']['select_base']),'array_header')]] + - - - - - Indicators - + Indicators + [[ array_header['Jan'] or '' ]][[ array_header[1] or '' ]] + [[ array_header['Feb'] or '' ]][[ array_header[2] or '' ]] + [[ array_header['Mar'] or '' ]][[ array_header[3] or '' ]] + [[ array_header['Apr'] or '' ]][[ array_header[4] or '' ]] + [[ array_header['May'] or '' ]][[ array_header[5] or '' ]] + [[ array_header['Jun'] or '' ]][[ array_header[6] or '' ]] + [[ array_header['Jul'] or '' ]][[ array_header[7] or '' ]] + [[ array_header['Aug'] or '' ]][[ array_header[8] or '' ]] + [[ array_header['Sep'] or '' ]] + [[ array_header['Oct'] or '' ]] + [[ array_header['Nov'] or '' ]] + [[ array_header['Dec'] or '' ]] -
-
+
+
[[ repeatIn(lines(data['form']),'obj')]] - [[ repeatIn(getarray(data['form'],obj,array_header=data['form']['select_base']),'array',td=len(data['form']['base_selection'][0][2]),data=data['form']['select_base']) or removeParentNode('section') ]] - +
+ [[ repeatIn(getarray(data['form'],obj,array_header=data['form']['select_base']),'array')]] + - - - - - [['.....'*(obj['level']) ]][[ setTag('font','font',{'color':'white'}) ]][[ obj['code'] ]] - + [['.....'*(obj['level']) ]][[ obj['code'] ]] + [[ array['Jan'] or '' ]][[ array[1] or '' ]] + [[ array['Feb'] or '' ]][[ array[2] or '' ]] + [[ array['Mar'] or '' ]][[ array[3] or '' ]] + [[ array['Apr'] or '' ]][[ array[4] or '' ]] + [[ array['May'] or '' ]][[ array[5] or '' ]] + [[ array['Jun'] or '' ]][[ array[6] or '' ]] + [[ array['Jul'] or '' ]][[ array[7] or '' ]] + [[ array['Aug'] or '' ]][[ array[8] or '' ]] + [[ array['Sep'] or '' ]] + [[ array['Oct'] or '' ]] + [[ array['Nov'] or '' ]] + [[ array['Dec'] or '' ]] - - -
- +
+
From e7b6f931a8736bd504bf97519ddbf34bbdd486c6 Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Tue, 2 Jun 2009 19:27:53 +0530 Subject: [PATCH 5/6] improved Fiscal statement report of Account_report module bzr revid: nch@tinyerp.com-20090602135753-ebsmk2m3nciyhs91 --- .../report/accounting_report.rml | 122 ++++++------------ 1 file changed, 38 insertions(+), 84 deletions(-) diff --git a/addons/account_report/report/accounting_report.rml b/addons/account_report/report/accounting_report.rml index c755303870e..95c9f03d1b0 100644 --- a/addons/account_report/report/accounting_report.rml +++ b/addons/account_report/report/accounting_report.rml @@ -65,90 +65,44 @@ -[[ repeatIn(objects,'o') ]] - - - - - - - - -Accounting Report - - - - - - - - - -[[ company.name ]] - - - - - - - -Currency: [[ company.currency_id.name]] - - - - -Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] - - - -Name - - -Code - - -Amount - - - - - - -
-[[repeatIn(childs(o.id),'obj')]] - - - -[[ '....'*(obj['level']) ]][[ obj['name'] ]] - - -[[obj['code'] ]] - - -[['%.2f' % obj['amount'] ]] - - - - -[[ repeatIn((obj['note'] and obj['note'].splitlines()) or [], 'l') ]] -[[ l or removeParentNode('table') ]] - - - - - - - - - - - - - - - - -
+ [[ repeatIn(objects,'o') ]] + + + + Accounting Report + + + + [[ company.name ]] + + Currency: [[ company.currency_id.name]] + + + Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]] + + + Name + Code + Amount + + + +
+ [[repeatIn(childs(o.id),'obj')]] + + + [[ '....'*(obj['level']) ]][[ obj['name'] ]] + [[obj['code'] ]] + [['%.2f' % obj['amount'] ]] + + + [[ repeatIn((obj['note'] and obj['note'].splitlines()) or [], 'l') ]][[ l or removeParentNode('table') ]] + + + + + +