Fix invoice report for bad removeParentNode
[odoo/odoo.git] / addons / account / report / invoice.rml
1 <?xml version="1.0"?>
2 <document filename="test.pdf">
3   <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
4     <pageTemplate id="first">
5       <frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
6     </pageTemplate>
7   </template>
8   <stylesheet>
9     <blockTableStyle id="Standard_Outline">
10       <blockAlignment value="LEFT"/>
11       <blockValign value="TOP"/>
12     </blockTableStyle>
13     <blockTableStyle id="Tableau2">
14       <blockAlignment value="LEFT"/>
15       <blockValign value="TOP"/>
16     </blockTableStyle>
17     <blockTableStyle id="Tableau6">
18       <blockAlignment value="LEFT"/>
19       <blockValign value="TOP"/>
20       <lineStyle kind="LINEBEFORE" colorName="#000000" start="0,0" stop="0,-1"/>
21       <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="0,0"/>
22       <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
23       <lineStyle kind="LINEBEFORE" colorName="#000000" start="1,0" stop="1,-1"/>
24       <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
25       <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
26       <lineStyle kind="LINEBEFORE" colorName="#000000" start="2,0" stop="2,-1"/>
27       <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
28       <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
29       <lineStyle kind="LINEBEFORE" colorName="#000000" start="3,0" stop="3,-1"/>
30       <lineStyle kind="LINEABOVE" colorName="#000000" start="3,0" stop="3,0"/>
31       <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
32       <lineStyle kind="LINEBEFORE" colorName="#000000" start="4,0" stop="4,-1"/>
33       <lineStyle kind="LINEABOVE" colorName="#000000" start="4,0" stop="4,0"/>
34       <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
35       <lineStyle kind="LINEBEFORE" colorName="#000000" start="5,0" stop="5,-1"/>
36       <lineStyle kind="LINEAFTER" colorName="#000000" start="5,0" stop="5,-1"/>
37       <lineStyle kind="LINEABOVE" colorName="#000000" start="5,0" stop="5,0"/>
38       <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
39       <blockBackground colorName="#e6e6e6" start="0,0" stop="0,-1"/>
40       <blockBackground colorName="#e6e6e6" start="1,0" stop="1,-1"/>
41       <blockBackground colorName="#e6e6e6" start="2,0" stop="2,-1"/>
42       <blockBackground colorName="#e6e6e6" start="3,0" stop="3,-1"/>
43       <blockBackground colorName="#e6e6e6" start="4,0" stop="4,-1"/>
44       <blockBackground colorName="#e6e6e6" start="5,0" stop="5,-1"/>
45     </blockTableStyle>
46     <blockTableStyle id="Tableau7">
47       <blockAlignment value="LEFT"/>
48       <blockValign value="TOP"/>
49     </blockTableStyle>
50     <blockTableStyle id="Tableau8">
51       <blockAlignment value="LEFT"/>
52       <blockValign value="TOP"/>
53     </blockTableStyle>
54     <blockTableStyle id="Tableau3">
55       <blockAlignment value="LEFT"/>
56       <blockValign value="TOP"/>
57       <blockBackground colorName="#e6e6e6" start="0,1" stop="0,-1"/>
58       <blockBackground colorName="#e6e6e6" start="1,1" stop="1,-1"/>
59       <blockBackground colorName="#e6e6e6" start="2,1" stop="2,-1"/>
60     </blockTableStyle>
61     <blockTableStyle id="Tableau4">
62       <blockAlignment value="LEFT"/>
63       <blockValign value="TOP"/>
64       <blockBackground colorName="#e6e6e6" start="0,0" stop="0,-1"/>
65       <blockBackground colorName="#e6e6e6" start="1,0" stop="1,-1"/>
66       <blockBackground colorName="#e6e6e6" start="2,0" stop="2,-1"/>
67     </blockTableStyle>
68     <blockTableStyle id="Tableau5">
69       <blockAlignment value="LEFT"/>
70       <blockValign value="TOP"/>
71     </blockTableStyle>
72     <initialize>
73       <paraStyle name="all" alignment="justify"/>
74     </initialize>
75     <paraStyle name="P1" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
76     <paraStyle name="P2" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
77     <paraStyle name="P3" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
78     <paraStyle name="P4" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
79     <paraStyle name="P5" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
80     <paraStyle name="P6" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
81     <paraStyle name="P7" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
82     <paraStyle name="P8" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
83     <paraStyle name="P9" fontName="Times-Italic" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
84     <paraStyle name="P10" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
85     <paraStyle name="P11" fontName="Times-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
86     <paraStyle name="P12" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
87     <paraStyle name="P13" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
88     <paraStyle name="P14" fontName="Times-Roman" fontSize="14.0" leading="17" alignment="LEFT"/>
89     <paraStyle name="P15" fontName="Times-Roman" fontSize="14.0" leading="17" alignment="CENTER"/>
90     <paraStyle name="P16" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="LEFT"/>
91     <paraStyle name="P17" fontName="Times-Roman" fontSize="11.0" leading="14"/>
92     <paraStyle name="P18" fontName="Times-Roman" fontSize="11.0" leading="14"/>
93     <paraStyle name="P19" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT"/>
94     <paraStyle name="P20" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="0.0"/>
95     <paraStyle name="P21" fontName="Times-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
96     <paraStyle name="P22" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
97     <paraStyle name="P23" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="LEFT"/>
98     <paraStyle name="Standard" fontName="Times-Roman"/>
99     <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
100     <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
101     <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
102     <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
103     <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
104     <paraStyle name="Index" fontName="Times-Roman"/>
105   </stylesheet>
106   <images/>
107   <story>
108     <para style="P1">[[ repeatIn(objects,'o') ]]</para>
109     <para style="P1">[[ setLang(o.partner_id.lang) ]]</para>
110     <blockTable colWidths="295.0,232.0" style="Tableau2">
111       <tr>
112         <td>
113           <para style="P2">
114             <font color="white"> </font>
115           </para>
116         </td>
117         <td>
118           <para style="Standard">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
119           <para style="Standard">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para>
120           <para style="Standard">[[ o.address_invoice_id.street ]]</para>
121           <para style="Standard">[[ o.address_invoice_id.street2 or '' ]]</para>
122           <para style="Standard">[[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]]</para>
123           <para style="Standard">[[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]]</para>
124           <para style="Standard">[[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]]</para>
125           <para style="Standard">
126             <font color="white"> </font>
127           </para>
128           <para style="Standard">Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]]</para>
129           <para style="Standard">Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]]</para>
130           <para style="Standard">VAT : [[ o.partner_id.vat or removeParentNode('para') ]]</para>
131         </td>
132       </tr>
133     </blockTable>
134     <para style="P14">
135       <font color="white"> </font>
136     </para>
137     <para style="P23">Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
138     <para style="P23">PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]]</para>
139     <para style="P23">Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]]</para>
140     <para style="P23">Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]]</para>
141     <para style="P23">Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
142     <para style="P23">Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]]</para>
143     <para style="P16">
144       <font face="Times-Roman">Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]]</font>
145       <font face="Times-Roman">[[ o.number ]]</font>
146     </para>
147     <para style="P15">
148       <font color="white"> </font>
149     </para>
150     <para style="P17">
151       <font face="Times-Roman">Document</font>
152       <font face="Times-Roman">:</font>
153       <font face="Times-Roman">[[o.name]]</font>
154     </para>
155     <para style="P17">
156       <font face="Times-Roman">Invoice Date: </font>
157       <font face="Times-Roman">[[o.date_invoice]]</font>
158     </para>
159     <para style="P18"><font face="Times-Roman">Customer Ref:</font> [[ o.address_invoice_id.partner_id.ref or '/' ]]</para>
160     <para style="Standard">
161       <font color="white"> </font>
162     </para>
163     <blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau6">
164       <tr>
165         <td>
166           <para style="P3">Description</para>
167         </td>
168         <td>
169           <para style="P4">Taxes</para>
170         </td>
171         <td>
172           <para style="P4">Quantity</para>
173         </td>
174         <td>
175           <para style="P4">Unit Price</para>
176         </td>
177         <td>
178           <para style="P4">Disc. (%)</para>
179         </td>
180         <td>
181           <para style="P4">Price</para>
182         </td>
183       </tr>
184     </blockTable>
185     <section>
186       <para style="P20">[[repeatIn(o.invoice_line,'l') ]]</para>
187       <blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau7">
188         <tr>
189           <td>
190             <para style="Table Contents">[[ l.name ]]</para>
191           </td>
192           <td>
193             <para style="P6">[[ ', '.join([lt.name for lt in l.invoice_line_tax_id]) ]]</para>
194           </td>
195           <td>
196             <para style="P8">[[ '%.2f' % l.quantity ]] [[l.uos_id and l.uos_id.name or '' ]]</para>
197           </td>
198           <td>
199             <para style="P8">[[ '%.2f' % l.price_unit ]]</para>
200           </td>
201           <td>
202             <para style="P8">[[ l.discount and '%.2f' % (l.discount) or '' ]] </para>
203           </td>
204           <td>
205             <para style="P8">[[ '%.2f' %l.price_subtotal ]] [[o.currency_id.code ]]</para>
206           </td>
207         </tr>
208       </blockTable>
209       <blockTable colWidths="28.0,499.0" style="Tableau8">
210         <tr>
211           <td>
212             <para style="P21">[[ repeatIn((l.note and l.note.splitlines()) or [], 'note') ]]</para>
213           </td>
214           <td>
215             <para style="P9">[[ note or removeParentNode('table') ]]</para>
216           </td>
217         </tr>
218       </blockTable>
219     </section>
220     <para style="Standard">
221       <font color="white"> </font>
222     </para>
223     <blockTable colWidths="215.0,313.0" style="Tableau3">
224       <tr>
225         <td>
226           <blockTable colWidths="81.0,73.0,60.0" style="Tableau4">
227             <tr>
228               <td>
229                 <para style="P10">Tax</para>
230               </td>
231               <td>
232                 <para style="P8">Base</para>
233               </td>
234               <td>
235                 <para style="P8">Amount</para>
236               </td>
237             </tr>
238             <tr>
239               <td>
240                 <para style="P5"><font face="Times-Roman">[[ repeatIn(o.tax_line,'t') ]]</font> [[ t.name ]]</para>
241               </td>
242               <td>
243                 <para style="P11">[[ '%.2f' % t.base ]]</para>
244               </td>
245               <td>
246                 <para style="P11">[[ '%.2f' % t.amount]]</para>
247               </td>
248             </tr>
249           </blockTable>
250         </td>
251         <td>
252           <blockTable colWidths="214.0,95.0" style="Tableau5">
253             <tr>
254               <td>
255                 <para style="P7">Total (excl. taxes):</para>
256               </td>
257               <td>
258                 <para style="P12">[[ '%.2f' % o.amount_untaxed ]] [[o.currency_id.code ]]</para>
259               </td>
260             </tr>
261             <tr>
262               <td>
263                 <para style="P7">Taxes:</para>
264               </td>
265               <td>
266                 <para style="P12">[[ '%.2f' % o.amount_tax ]] [[o.currency_id.code ]]</para>
267               </td>
268             </tr>
269             <tr>
270               <td>
271                 <para style="P13">Total <font face="Times-Roman">(incl. taxes):</font></para>
272               </td>
273               <td>
274                 <para style="P22">[[ '%.2f' % o.amount_total ]] [[o.currency_id.code ]]</para>
275               </td>
276             </tr>
277           </blockTable>
278           <para style="Table Contents">
279             <font color="white"> </font>
280           </para>
281         </td>
282       </tr>
283     </blockTable>
284     <para style="P19">[[ format(o.comment or '') ]]</para>
285     <para style="P19">
286       <font color="white"> </font>
287     </para>
288     <para style="P19">[[ format((o.payment_term and o.payment_term.note) or '') ]]</para>
289   </story>
290 </document>
291