Merge lp:~nch-openerp/openobject-addons/addons_5stable into lp:openobject-addons/5.0

Proposed by Naresh(OpenERP)
Status: Merged
Merged at revision: not available
Proposed branch: lp:~nch-openerp/openobject-addons/addons_5stable
Merge into: lp:openobject-addons/5.0
Diff against target: None lines
To merge this branch: bzr merge lp:~nch-openerp/openobject-addons/addons_5stable
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+6465@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Bugfixes: Bugs related to reports on launchpad with new report engine

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/report/account_balance.rml'
--- account/report/account_balance.rml 2009-04-14 09:06:55 +0000
+++ account/report/account_balance.rml 2009-05-12 12:04:06 +0000
@@ -57,9 +57,12 @@
57 <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>57 <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
58 </blockTableStyle>58 </blockTableStyle>
59 <blockTableStyle id="Table2">59 <blockTableStyle id="Table2">
60 <blockValign value="TOP"/>
61 <blockAlignment value="RIGHT"/>
60 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>62 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/>
61 <blockValign value="TOP"/>63 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,1" stop="-1,1"/>
62 <blockAlignment value="RIGHT" start="2,1" stop="-1,-1"/>64 <lineStyle kind="LINEBELOW" colorName="#000000" start="0,2" stop="-1,-1"/>
65
63 </blockTableStyle>66 </blockTableStyle>
64 <blockTableStyle id="Table3">67 <blockTableStyle id="Table3">
65 <blockAlignment value="LEFT"/>68 <blockAlignment value="LEFT"/>
@@ -85,17 +88,18 @@
85 <initialize>88 <initialize>
86 <paraStyle name="all" alignment="justify"/>89 <paraStyle name="all" alignment="justify"/>
87 </initialize>90 </initialize>
88 <paraStyle name="P1" fontName="Helvetica" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>91 <paraStyle name="P1" fontName="Helvetica-Bold" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
89 <paraStyle name="P2" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>92 <paraStyle name="P2" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
90 <paraStyle name="P3" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>93 <paraStyle name="P3" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
91 <paraStyle name="P10" fontName="Helvetica" fontSize="8.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>94 <paraStyle name="P10" fontName="Helvetica" fontSize="8.0" leading="14" spaceBefore="0.0" spaceAfter="6.0" alignment="RIGHT"/>
92 <paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="14.5" leftIndent="-5.0"/>95 <paraStyle name="P9" fontName="Helvetica-Bold" alignment="CENTER" fontSize="14.5" leftIndent="-5.0"/>
93 <paraStyle name="P9a" fontName="Helvetica-Bold" fontSize="9" leftIndent="0.0" alignment="LEFT"/>96 <paraStyle name="P9a" fontName="Helvetica-Bold" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
94 <paraStyle name="P9b" fontName="Helvetica" fontSize="9" leftIndent="0.0" alignment="LEFT"/>97 <paraStyle name="P9b" fontName="Helvetica" fontSize="9" leftIndent="0.0" alignment="LEFT"/>
95 <paraStyle name="P9b" fontName="Helvetica" fontSize="8" leftIndent="-5.0" alignment="LEFT"/>98 <paraStyle name="P9b" fontName="Helvetica" fontSize="8" leftIndent="-5.0" alignment="LEFT"/>
96 <paraStyle name="P12" fontName="Helvetica" fontSize="8.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>99 <paraStyle name="P12" fontName="Helvetica-Bold" fontSize="8.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
97 <paraStyle name="P12a" fontName="Helvetica" fontSize="8.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>100 <paraStyle name="P12a" fontName="Helvetica" fontSize="8.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
98 <paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>101 <paraStyle name="P12b" fontName="Helvetica" fontSize="8.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
102 <paraStyle name="P14" rightIndent="17.0" leftIndent="-0.0" fontName="Helvetica-Bold" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
99103
100104
101 <blockTableStyle id="TrLevel">105 <blockTableStyle id="TrLevel">
@@ -122,7 +126,6 @@
122 fontSize="8.0" />126 fontSize="8.0" />
123 <paraStyle127 <paraStyle
124 name="Level2"128 name="Level2"
125
126 fontName="Helvetica-Bold"129 fontName="Helvetica-Bold"
127 fontSize="8.0" />130 fontSize="8.0" />
128 <paraStyle name="Level1"131 <paraStyle name="Level1"
@@ -158,7 +161,7 @@
158 <para style="P12a">Code</para>161 <para style="P12a">Code</para>
159 </td>162 </td>
160 <td>163 <td>
161 <para style="P12">Account</para>164 <para style="P12b">Account</para>
162 </td>165 </td>
163 <td>166 <td>
164 <para style="P10">Debit</para>167 <para style="P10">Debit</para>
@@ -173,11 +176,11 @@
173 <tr>176 <tr>
174 <td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>177 <td><para style="P14">[[ repeatIn(lines(data['form']), 'a') ]]<i>[[ a['code'] or removeParentNode('tr') ]]</i></para></td>
175 <td>178 <td>
176
177 <para style="P14">179 <para style="P14">
180 <font color="white">[[ ...*(a['level']) ]]</font> [[ a['name'] ]]
178 <font>[[ (a['level']&lt;3 and setTag('tr','tr',{'style':'TrLevel'+str(a['level']), 'paraStyle':('Level'+str(a['level']))})) or removeParentNode('font') ]]</font>181 <font>[[ (a['level']&lt;3 and setTag('tr','tr',{'style':'TrLevel'+str(a['level']), 'paraStyle':('Level'+str(a['level']))})) or removeParentNode('font') ]]</font>
179 <font>[[ (a['level']&gt;2 and setTag('tr','tr',{'style':'TrLevel', 'paraStyle':('Level')})) or removeParentNode('font') ]] </font>182 <font>[[ (a['level']&gt;2 and setTag('tr','tr',{'style':'TrLevel', 'paraStyle':('Level')})) or removeParentNode('font') ]] </font>
180 <font color="white">[[ '...'*(a['level']) ]]</font> [[ a['name'] ]]</para>183 </para>
181 </td>184 </td>
182 <td>185 <td>
183 <para style="P3"><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font>186 <para style="P3"><font>[[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]]</font>
@@ -194,4 +197,4 @@
194 </tr>197 </tr>
195 </blockTable>198 </blockTable>
196 </story>199 </story>
197</document>200</document>
198\ No newline at end of file201\ No newline at end of file
199202
=== modified file 'account_invoice_layout/report/report_account_invoice_layout.py'
--- account_invoice_layout/report/report_account_invoice_layout.py 2009-04-06 14:35:41 +0000
+++ account_invoice_layout/report/report_account_invoice_layout.py 2009-05-12 11:23:05 +0000
@@ -1,7 +1,7 @@
1# -*- encoding: utf-8 -*-1# -*- encoding: utf-8 -*-
2##############################################################################2##############################################################################
3#3#
4# OpenERP, Open Source Management Solution 4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6# $Id$6# $Id$
7#7#
@@ -23,79 +23,17 @@
23import pooler23import pooler
24from report import report_sxw24from report import report_sxw
2525
26parents = {
27 'tr':1,
28 'li':1,
29 'story': 0,
30 'section': 0
31 }
32
33class account_invoice_1(report_sxw.rml_parse):26class account_invoice_1(report_sxw.rml_parse):
34 def __init__(self, cr, uid, name, context):27 def __init__(self, cr, uid, name, context):
35 super(account_invoice_1, self).__init__(cr, uid, name, context)28 super(account_invoice_1, self).__init__(cr, uid, name, context)
36 self.localcontext.update({29 self.localcontext.update({
37 'time': time,30 'time': time,
38 'invoice_lines': self.invoice_lines,31 'invoice_lines': self.invoice_lines,
39 'repeat_In':self.repeat_In,
40 })32 })
41 self.context = context33 self.context = context
4234 self._node = None
43 def repeat_In(self, lst, name, nodes_parent=False,td=False,width=[],value=[],type=[]):
44 self._node.data = ''
45 node = self._find_parent(self._node, nodes_parent or parents)
46 ns = node.nextSibling
47
48 value=['tax_types','quantity','uos','price_unit','discount','price_subtotal','currency']
49 type=['string','string','string','string','string','string','string']
50 width=[62,38,29,67,53,53,27]
51 td=7
52
53 tableFlag=0
54
55 if not lst:
56 lst.append(1)
57 for ns in node.childNodes :
58 if tableFlag==1:
59 break
60 if ns and ns.nodeName!='#text' and ns.tagName=='blockTable' and td :
61 tableFlag=1
62
63 width_str = ns._attrs['colWidths'].nodeValue
64 ns.removeAttribute('colWidths')
65 total_td = td * len(value)
66
67 if not width:
68 for v in value:
69 width.append(30)
70 for v in range(len(value)):
71 width_str +=',%d'%width[v]
72
73 ns.setAttribute('colWidths',width_str)
74
75 child_list = ns.childNodes
76
77 for child in child_list:
78 if child.nodeName=='tr':
79 lc = child.childNodes[1]
80# for t in range(td):
81 i=0
82 for v in value:
83 t2="[[%s['type']=='text' and removeParentNode('tr')]]"%(name)
84 t1= "[[ %s['%s'] ]]"%(name,v)
85 t3="[[ %s['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]]"%name
86 newnode = lc.cloneNode(1)
87
88 newnode.childNodes[1].lastChild.data = t1 + t2 +t3
89# newnode.childNodes[1].lastChild.data=[[ a['status']==1 and ( setTag('para','para',{'fontName':'Times-bold'})) ]]
90 child.appendChild(newnode)
91 newnode=False
92 i+=1
93
94
95 return super(account_invoice_1,self).repeatIn(lst, name, nodes_parent=False)
9635
97 def invoice_lines(self,invoice):36 def invoice_lines(self,invoice):
98
99 result =[]37 result =[]
100 sub_total={}38 sub_total={}
101 info=[]39 info=[]
@@ -107,7 +45,6 @@
107 for id in range(0,len(ids)):45 for id in range(0,len(ids)):
108 info = self.pool.get('account.invoice.line').browse(self.cr, self.uid,ids[id], self.context.copy())46 info = self.pool.get('account.invoice.line').browse(self.cr, self.uid,ids[id], self.context.copy())
109 list_in_seq[info]=info.sequence47 list_in_seq[info]=info.sequence
110# invoice_list +=[info]
111 i=148 i=1
112 j=049 j=0
113 final=sorted(list_in_seq.items(), lambda x, y: cmp(x[1], y[1]))50 final=sorted(list_in_seq.items(), lambda x, y: cmp(x[1], y[1]))
@@ -116,11 +53,9 @@
116 sum_flag[j]=-153 sum_flag[j]=-1
117 for entry in invoice_list:54 for entry in invoice_list:
118 res={}55 res={}
119
120 if entry.state=='article':56 if entry.state=='article':
121 self.cr.execute('select tax_id from account_invoice_line_tax where invoice_line_id=%s', (entry.id,))57 self.cr.execute('select tax_id from account_invoice_line_tax where invoice_line_id=%s', (entry.id,))
122 tax_ids=self.cr.fetchall()58 tax_ids=self.cr.fetchall()
123
124 if tax_ids==[]:59 if tax_ids==[]:
125 res['tax_types']=''60 res['tax_types']=''
126 else:61 else:
@@ -187,14 +122,14 @@
187 res['price_subtotal']=''122 res['price_subtotal']=''
188 res['currency']=''123 res['currency']=''
189 elif entry.state=='line':124 elif entry.state=='line':
190 res['quantity']='____________'125 res['quantity']='_______________'
191 res['price_unit']='______________'126 res['price_unit']='______________'
192 res['discount']='____________'127 res['discount']='____________'
193 res['tax_types']='_________________'128 res['tax_types']='____________________'
194 res['uos']='_____'129 res['uos']='_____'
195 res['name']='________________________________________'130 res['name']='_______________________________________________'
196 res['price_subtotal']='_______________________'131 res['price_subtotal']='____________'
197 res['currency']='_______'132 res['currency']='____'
198 elif entry.state=='break':133 elif entry.state=='break':
199 res['type']=entry.state134 res['type']=entry.state
200 res['name']=entry.name135 res['name']=entry.name
201136
=== modified file 'account_invoice_layout/report/report_account_invoice_layout.rml'
--- account_invoice_layout/report/report_account_invoice_layout.rml 2009-04-06 14:35:41 +0000
+++ account_invoice_layout/report/report_account_invoice_layout.rml 2009-05-12 12:04:06 +0000
@@ -130,8 +130,7 @@
130<font color="white"> </font>130<font color="white"> </font>
131</para>131</para>
132<para style="P17">132<para style="P17">
133<font face="Times-Roman">Document</font>133<font face="Times-Roman">Document:</font>
134<font face="Times-Roman">:</font>
135<font face="Times-Roman">[[o.name]]</font>134<font face="Times-Roman">[[o.name]]</font>
136</para>135</para>
137<para style="P17">136<para style="P17">
@@ -143,7 +142,7 @@
143<para style="Standard">142<para style="Standard">
144<font color="white"> </font>143<font color="white"> </font>
145</para>144</para>
146<blockTable colWidths="198.0,62.0,67.0,67.0,53.0,80.0" style="Tableau6">145<blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau6">
147<tr>146<tr>
148<td>147<td>
149<para style="P3">Description</para>148<para style="P3">Description</para>
@@ -166,64 +165,80 @@
166</tr>165</tr>
167</blockTable>166</blockTable>
168<section>167<section>
169<para style="P20">[[ repeat_In(invoice_lines(o), 'a') ]]</para>168 <para style="P20">[[ repeatIn(invoice_lines(o), 'a') ]]</para>
170<blockTable colWidths="0.0,198.0" style="Tableau7">169 <blockTable colWidths="0.0,216.0,62,38,29,67,53,53" style="Tableau7">
171<tr>170 <tr>
172<td>171 <td>
173<para style="P8">[[ a['type']=='text' and removeParentNode('tr')]]</para>172 <para style="P8">[[ a['type']=='text' and removeParentNode('blockTable')]]</para>
174</td>173 </td>
175<td>174 <td>
176<para style="Table Contents"><font>[[ a['type']=='title' and ( setTag('font','font',{'size':'11.5'})) ]][[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('font','font',{'name':'Times-bold'})) ]][[ a['type']=='text' and removeParentNode('font') or a['name'] ]]</font></para>175 <para style="Table Contents">[[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['name'] ]]</para>
177</td>176 </td>
178</tr>177 <td>
179</blockTable>178 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['tax_types'] ]]</para>
180<blockTable colWidths="447.0,80.0" style="Tableau8">179 </td>
181<tr>180 <td>
182<td>181 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['quantity'] ]][[ a['uos'] ]]</para>
183<para style="Table Contents">[[ a['type']=='text' and a['name'] or removeParentNode('table') ]]</para>182 </td>
184</td>183 <td>
185<td>184 <para><font color="white"></font></para>
186<para style="P8">[[ a['type']=='text' and '' or removeParentNode('table') ]]</para>185 </td>
187</td>186 <td>
188</tr>187 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['price_unit'] ]]</para>
189</blockTable>188 </td>
190<blockTable colWidths="28.0,499.0" style="Tableau8">189 <td>
191<tr>190 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['discount'] ]]</para>
192<td>191 </td>
193<para style="P21">[[ a['note']=='' and removeParentNode('table') ]][[ repeatIn(( a['note'] and a['note'].splitlines()) or [], 'note') ]]</para>192 <td>
194</td>193 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['price_subtotal'] ]][[ a['currency'] ]]</para>
195<td>194 </td>
196<para style="P9">[[ note or removeParentNode('table') ]]</para>195 </tr>
197</td>196 </blockTable>
198</tr>197 <blockTable colWidths="453.0,74.0" style="Tableau8">
199</blockTable>198 <tr>
200<pageBreak>[[ a['type']!='break' and removeParentNode('pageBreak')]]</pageBreak>199 <td>
201<blockTable colWidths="198.0,62.0,67.0,67.0,53.0,80.0" style="Tableau6">200 <para style="Table Contents">[[ a['type']=='text' and a['name'] or removeParentNode('blockTable') ]]</para>
202<tr>201 </td>
203<td>202 <td>
204<para style="P3">Description [[ a['type']!='break' and removeParentNode('tr')]]</para>203 <para style="P8">[[ a['type']=='text' and '' or removeParentNode('blockTable') ]]</para>
205</td>204 </td>
206<td>205 </tr>
207<para style="P4">Taxes</para>206 </blockTable>
208</td>207 <blockTable colWidths="28.0,499.0" style="Tableau8">
209<td>208 <tr>
210<para style="P4">Quantity</para>209 <td>
211</td>210 <para style="P21"><font>[[ a['note']=='' and removeParentNode('blockTable') ]]</font><font>[[ repeatIn(( a['note'] and a['note'].splitlines()) or [], 'note') ]]</font></para>
212<td>211 </td>
213<para style="P4">Unit Price</para>212 <td>
214</td>213 <para style="P9">[[ note or removeParentNode('blockTable') ]]</para>
215<td>214 </td>
216<para style="P4">Disc. (%)</para>215 </tr>
217</td>216 </blockTable>
218<td>217 <pageBreak>[[ a['type']!='break' and removeParentNode('pageBreak')]]</pageBreak>
219<para style="P4">Price</para>218 <blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau6">
220</td>219 <tr>
221</tr>220 <td>
222</blockTable>221 <para style="P3">Description [[ a['type']!='break' and removeParentNode('blockTable')]]</para>
222 </td>
223 <td>
224 <para style="P4">Taxes</para>
225 </td>
226 <td>
227 <para style="P4">Quantity</para>
228 </td>
229 <td>
230 <para style="P4">Unit Price</para>
231 </td>
232 <td>
233 <para style="P4">Disc. (%)</para>
234 </td>
235 <td>
236 <para style="P4">Price</para>
237 </td>
238 </tr>
239 </blockTable>
223</section>240</section>
224<para style="Standard">241
225<font color="white"> </font>
226</para>
227<blockTable colWidths="215.0,313.0" style="Tableau3">242<blockTable colWidths="215.0,313.0" style="Tableau3">
228<tr>243<tr>
229<td>244<td>
@@ -281,16 +296,11 @@
281</td>296</td>
282</tr>297</tr>
283</blockTable>298</blockTable>
284<para style="Table Contents">299
285<font color="white"> </font>
286</para>
287</td>300</td>
288</tr>301</tr>
289</blockTable>302</blockTable>
290<para style="P19">[[ format(o.comment) or '' ]]</para>303<para style="P19">[[ format(o.comment) or '' ]]</para>
291<para style="P19">
292<font color="white"> </font>
293</para>
294<para style="P19">[[ format(o.payment_term and o.payment_term.note) or '' ]]</para>304<para style="P19">[[ format(o.payment_term and o.payment_term.note) or '' ]]</para>
295</story>305</story>
296</document>306</document>
297307
=== modified file 'account_invoice_layout/report/report_account_invoice_layout.sxw'
298Binary files account_invoice_layout/report/report_account_invoice_layout.sxw 2009-01-08 12:35:15 +0000 and account_invoice_layout/report/report_account_invoice_layout.sxw 2009-05-12 11:23:05 +0000 differ308Binary files account_invoice_layout/report/report_account_invoice_layout.sxw 2009-01-08 12:35:15 +0000 and account_invoice_layout/report/report_account_invoice_layout.sxw 2009-05-12 11:23:05 +0000 differ
=== modified file 'account_invoice_layout/report/special_message_invoice.py'
--- account_invoice_layout/report/special_message_invoice.py 2009-01-04 22:12:50 +0000
+++ account_invoice_layout/report/special_message_invoice.py 2009-05-12 12:17:56 +0000
@@ -1,7 +1,7 @@
1# -*- encoding: utf-8 -*-1# -*- encoding: utf-8 -*-
2##############################################################################2##############################################################################
3#3#
4# OpenERP, Open Source Management Solution 4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved5# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
6# $Id$6# $Id$
7#7#
@@ -23,12 +23,6 @@
23import time23import time
24from report import report_sxw24from report import report_sxw
25import pooler25import pooler
26parents = {
27 'tr':1,
28 'li':1,
29 'story': 0,
30 'section': 0
31 }
3226
33class account_invoice_with_message(report_sxw.rml_parse):27class account_invoice_with_message(report_sxw.rml_parse):
34 def __init__(self, cr, uid, name, context):28 def __init__(self, cr, uid, name, context):
@@ -37,67 +31,13 @@
37 'time': time,31 'time': time,
38 'spcl_msg': self.spcl_msg,32 'spcl_msg': self.spcl_msg,
39 'invoice_lines': self.invoice_lines,33 'invoice_lines': self.invoice_lines,
40 'repeat_In':self.repeat_In,
4134
42 })35 })
43 self.context = context36 self.context = context
4437
45 def repeat_In(self, lst, name, nodes_parent=False,td=False,width=[],value=[],type=[]):
46 self._node.data = ''
47 node = self._find_parent(self._node, nodes_parent or parents)
48 ns = node.nextSibling
49
50 value=['tax_types','quantity','uos','price_unit','discount','price_subtotal','currency']
51 type=['string','string','string','string','string','string','string']
52 width=[62,42,20,62,51,50,24]
53 td=7
54
55 tableFlag=0
56
57 if not lst:
58 lst.append(1)
59 for ns in node.childNodes :
60 if tableFlag==1:
61 break
62 if ns and ns.nodeName!='#text' and ns.tagName=='blockTable' and td :
63 tableFlag=1
64
65 width_str = ns._attrs['colWidths'].nodeValue
66 ns.removeAttribute('colWidths')
67 total_td = td * len(value)
68
69 if not width:
70 for v in value:
71 width.append(30)
72 for v in range(len(value)):
73 width_str +=',%d'%width[v]
74
75 ns.setAttribute('colWidths',width_str)
76
77 child_list = ns.childNodes
78
79 for child in child_list:
80 if child.nodeName=='tr':
81 lc = child.childNodes[1]
82 # for t in range(td):
83 i=0
84 for v in value:
85 t2="[[%s['type']=='text' and removeParentNode('tr')]]"%(name)
86 t1= "[[ %s['%s'] ]]"%(name,v)
87 t3="[[ %s['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]]"%name
88 newnode = lc.cloneNode(1)
89
90 newnode.childNodes[1].lastChild.data = t1 + t2 +t3
91 # newnode.childNodes[1].lastChild.data=[[ a['status']==1 and ( setTag('para','para',{'fontName':'Times-bold'})) ]]
92 child.appendChild(newnode)
93 newnode=False
94 i+=1
95
96 return super(account_invoice_with_message,self).repeatIn(lst, name, nodes_parent=False)
97
98 def spcl_msg(self, form):38 def spcl_msg(self, form):
99 account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, form['message'])39 account_msg_data = pooler.get_pool(self.cr.dbname).get('notify.message').browse(self.cr, self.uid, form['message'])
100 msg = account_msg_data.msg 40 msg = account_msg_data.msg
101 return msg41 return msg
10242
10343
@@ -113,7 +53,6 @@
113 for id in range(0,len(ids)):53 for id in range(0,len(ids)):
114 info = self.pool.get('account.invoice.line').browse(self.cr, self.uid,ids[id], self.context.copy())54 info = self.pool.get('account.invoice.line').browse(self.cr, self.uid,ids[id], self.context.copy())
115 list_in_seq[info]=info.sequence55 list_in_seq[info]=info.sequence
116 # invoice_list +=[info]
117 i=156 i=1
118 j=057 j=0
119 final=sorted(list_in_seq.items(), lambda x, y: cmp(x[1], y[1]))58 final=sorted(list_in_seq.items(), lambda x, y: cmp(x[1], y[1]))
@@ -198,9 +137,9 @@
198 res['discount']='____________'137 res['discount']='____________'
199 res['tax_types']='_________________'138 res['tax_types']='_________________'
200 res['uos']='_____'139 res['uos']='_____'
201 res['name']='________________________________________'140 res['name']='_____________________________________________'
202 res['price_subtotal']='_______________________'141 res['price_subtotal']='_____________________'
203 res['currency']='_______'142 res['currency']='_'
204 elif entry.state=='break':143 elif entry.state=='break':
205 res['type']=entry.state144 res['type']=entry.state
206 res['name']=entry.name145 res['name']=entry.name
207146
=== modified file 'account_invoice_layout/report/special_message_invoice.rml'
--- account_invoice_layout/report/special_message_invoice.rml 2009-01-08 12:35:15 +0000
+++ account_invoice_layout/report/special_message_invoice.rml 2009-05-12 12:17:56 +0000
@@ -130,8 +130,7 @@
130<font color="white"> </font>130<font color="white"> </font>
131</para>131</para>
132<para style="P17">132<para style="P17">
133<font face="Times-Roman">Document</font>133<font face="Times-Roman">Document:</font>
134<font face="Times-Roman">:</font>
135<font face="Times-Roman">[[o.name]]</font>134<font face="Times-Roman">[[o.name]]</font>
136</para>135</para>
137<para style="P17">136<para style="P17">
@@ -166,64 +165,80 @@
166</tr>165</tr>
167</blockTable>166</blockTable>
168<section>167<section>
169<para style="P20">[[ repeat_In(invoice_lines(o), 'a') ]]</para>168 <para style="P20">[[ repeatIn(invoice_lines(o), 'a') ]]</para>
170<blockTable colWidths="0.0,216.0" style="Tableau7">169 <blockTable colWidths="0.0,216.0,62,38,29,67,53,53" style="Tableau7">
171<tr>170 <tr>
172<td>171 <td>
173<para style="P8">[[ a['type']=='text' and removeParentNode('tr')]]</para>172 <para style="P8">[[ a['type']=='text' and removeParentNode('blockTable')]]</para>
174</td>173 </td>
175<td>174 <td>
176<para style="Table Contents"><font>[[ a['type']=='title' and ( setTag('font','font',{'size':'11.5'})) ]][[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('font','font',{'name':'Times-bold'})) ]][[ a['type']=='text' and removeParentNode('font') or a['name'] ]]</font></para>175 <para style="Table Contents">[[ (a['type']=='title' or a['type']=='subtotal') and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['name'] ]]</para>
177</td>176 </td>
178</tr>177 <td>
179</blockTable>178 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['tax_types'] ]]</para>
180<blockTable colWidths="453.0,74.0" style="Tableau8">179 </td>
181<tr>180 <td>
182<td>181 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['quantity'] ]][[ a['uos'] ]]</para>
183<para style="Table Contents">[[ a['type']=='text' and a['name'] or removeParentNode('table') ]]</para>182 </td>
184</td>183 <td>
185<td>184 <para><font color="white"></font></para>
186<para style="P8">[[ a['type']=='text' and '' or removeParentNode('table') ]]</para>185 </td>
187</td>186 <td>
188</tr>187 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['price_unit'] ]]</para>
189</blockTable>188 </td>
190<blockTable colWidths="28.0,499.0" style="Tableau8">189 <td>
191<tr>190 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['discount'] ]]</para>
192<td>191 </td>
193<para style="P21">[[ a['note']=='' and removeParentNode('table') ]][[ repeatIn(( a['note'] and a['note'].splitlines()) or [], 'note') ]]</para>192 <td>
194</td>193 <para style="Table Contents">[[ a['type']=='subtotal' and ( setTag('para','para',{'fontName':'Times-bold'})) ]][[ a['price_subtotal'] ]][[ a['currency'] ]]</para>
195<td>194 </td>
196<para style="P9">[[ note or removeParentNode('table') ]]</para>195 </tr>
197</td>196 </blockTable>
198</tr>197 <blockTable colWidths="453.0,74.0" style="Tableau8">
199</blockTable>198 <tr>
200<pageBreak>[[ a['type']!='break' and removeParentNode('pageBreak')]]</pageBreak>199 <td>
201<blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau6">200 <para style="Table Contents">[[ a['type']=='text' and a['name'] or removeParentNode('blockTable') ]]</para>
202<tr>201 </td>
203<td>202 <td>
204<para style="P3">Description [[ a['type']!='break' and removeParentNode('tr')]]</para>203 <para style="P8">[[ a['type']=='text' and '' or removeParentNode('blockTable') ]]</para>
205</td>204 </td>
206<td>205 </tr>
207<para style="P4">Taxes</para>206 </blockTable>
208</td>207 <blockTable colWidths="28.0,499.0" style="Tableau8">
209<td>208 <tr>
210<para style="P4">Quantity</para>209 <td>
211</td>210 <para style="P21"><font>[[ a['note']=='' and removeParentNode('blockTable') ]]</font><font>[[ repeatIn(( a['note'] and a['note'].splitlines()) or [], 'note') ]]</font></para>
212<td>211 </td>
213<para style="P4">Unit Price</para>212 <td>
214</td>213 <para style="P9">[[ note or removeParentNode('blockTable') ]]</para>
215<td>214 </td>
216<para style="P4">Disc. (%)</para>215 </tr>
217</td>216 </blockTable>
218<td>217 <pageBreak>[[ a['type']!='break' and removeParentNode('pageBreak')]]</pageBreak>
219<para style="P4">Price</para>218 <blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau6">
220</td>219 <tr>
221</tr>220 <td>
222</blockTable>221 <para style="P3">Description [[ a['type']!='break' and removeParentNode('blockTable')]]</para>
222 </td>
223 <td>
224 <para style="P4">Taxes</para>
225 </td>
226 <td>
227 <para style="P4">Quantity</para>
228 </td>
229 <td>
230 <para style="P4">Unit Price</para>
231 </td>
232 <td>
233 <para style="P4">Disc. (%)</para>
234 </td>
235 <td>
236 <para style="P4">Price</para>
237 </td>
238 </tr>
239 </blockTable>
223</section>240</section>
224<para style="Standard">241
225<font color="white"> </font>
226</para>
227<blockTable colWidths="215.0,313.0" style="Tableau3">242<blockTable colWidths="215.0,313.0" style="Tableau3">
228<tr>243<tr>
229<td>244<td>
@@ -281,16 +296,11 @@
281</td>296</td>
282</tr>297</tr>
283</blockTable>298</blockTable>
284<para style="Table Contents">299
285<font color="white"> </font>
286</para>
287</td>300</td>
288</tr>301</tr>
289</blockTable>302</blockTable>
290<para style="P19">[[ format(o.comment) or '' ]]</para>303<para style="P19">[[ format(o.comment) or '' ]]</para>
291<para style="P19">
292<font color="white"> </font>
293</para>
294<para style="P19">[[ format(o.payment_term and o.payment_term.note) or '' ]]</para>304<para style="P19">[[ format(o.payment_term and o.payment_term.note) or '' ]]</para>
295<section>305<section>
296<para style="P19">[[ repeatIn((spcl_msg(data['form']) and spcl_msg(data['form']).splitlines()) or [], 'note') ]]</para>306<para style="P19">[[ repeatIn((spcl_msg(data['form']) and spcl_msg(data['form']).splitlines()) or [], 'note') ]]</para>