[IMP] FormView: use name_get for the form title
[odoo/odoo.git] / addons / mrp / report / price.xsl
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
3
4         <xsl:import href="custom_default.xsl"/>
5         <xsl:import href="custom_rml.xsl"/>
6         <xsl:variable name="page_format">a4_normal</xsl:variable>
7
8
9         <xsl:template match="/">
10                 <xsl:call-template name="rml"/>
11         </xsl:template>
12
13         <!-- stylesheet -->
14
15         <xsl:template name="stylesheet">
16                 <paraStyle name="title" fontName="Helvetica-Bold" fontSize="15.0" alignment="center"/>
17                 <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT"/>
18                 <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
19                 <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT"/>
20                 <paraStyle name="terp_tblheader_Details_Right_bold" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT"/>
21
22                 <blockTableStyle id="header">
23                         <blockValign value="TOP"/>
24                          <blockAlignment value="RIGHT"/>
25                          <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,-1"/>
26                 </blockTableStyle>
27                 <blockTableStyle id="lines">
28                         <blockValign value="TOP"/>
29                          <blockAlignment value="RIGHT"/>
30                          <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,0" stop="-1,-1"/>
31                 </blockTableStyle>
32                 <blockTableStyle id="total">
33                         <blockValign value="TOP"/>
34                         <blockAlignment value="RIGHT"/>
35                         <lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="0,0" stop="-1,-1"/>
36                 </blockTableStyle>
37                 <blockTableStyle id="sub_total">
38                         <blockValign value="TOP"/>
39                          <blockAlignment value="RIGHT"/>
40                          <lineStyle kind="LINEBELOW" colorName="#FFFFFF" start="0,0" stop="-1,-1"/>
41                 </blockTableStyle>
42 </xsl:template>
43
44         <xsl:template name="story">
45                 <xsl:apply-templates select="report"/>
46         </xsl:template>
47
48         <xsl:template match="report">
49                 <xsl:apply-templates select="config"/>
50                 <xsl:apply-templates select="title"/>
51                 <xsl:apply-templates select="lines"/>
52         </xsl:template>
53
54         <xsl:template match="config">
55                 <para style="title">
56                 <xsl:value-of select="report-header"/>
57                 </para>
58         </xsl:template>
59
60         <xsl:template match="title">
61                 <para style="title">
62                 <xsl:value-of select="."/>
63                 </para>
64                 <spacer length="1cm" width="2mm"/>
65         </xsl:template>
66
67
68         <xsl:template match="header">
69                 <tr>
70                 <xsl:for-each select="field">
71                         <td>
72                         <para style="terp_tblheader_General">
73                         <xsl:value-of select="."/>
74                         </para>
75                         </td>
76                 </xsl:for-each>
77                 </tr>
78         </xsl:template>
79
80         <xsl:template match="lines">
81
82         <xsl:apply-templates select="title"/>
83                 <blockTable>
84                 <xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute>
85                  <xsl:attribute name="colWidths">
86                          <xsl:value-of select="../config/tableSize"/>
87                  </xsl:attribute>
88
89                 <xsl:apply-templates select="row"/>
90
91                 </blockTable>
92
93                 <xsl:if test="@style!='header'">
94                         <spacer length="2mm" width="2mm"/>
95
96                 </xsl:if>
97                 <xsl:if test="@style='total'">
98                         <xsl:if test="position() &lt; last()">
99                                 <pageBreak/>
100                         </xsl:if>
101                 </xsl:if>
102
103         </xsl:template>
104
105         <xsl:template match="row">
106                 <tr>
107                 <xsl:apply-templates select="col"/>
108                 </tr>
109         </xsl:template>
110
111         <xsl:template match="col">
112                 <td>
113                         <xsl:choose>
114                                 <xsl:when test="@para='yes'">
115                                         <xsl:choose>
116                                                 <xsl:when test="@tree='yes'">
117                                                         <para style="terp_default_8">
118                                                                 <xsl:attribute name="leftIndent"><xsl:value-of select="@space"/></xsl:attribute>
119                                                                 <xsl:value-of select="."/>
120                                                         </para>
121                                                 </xsl:when>
122                                                 <xsl:otherwise>
123                                                         <para style="terp_default_8">
124                                                                 <xsl:value-of select="."/>
125                                                         </para>
126                                                 </xsl:otherwise>
127                                         </xsl:choose>
128                                 </xsl:when>
129                                 <xsl:when test="@f='yes'">
130                                         <para style="terp_tblheader_Details_Right">
131                                                 <xsl:value-of select="."/>
132                                         </para>
133                                 </xsl:when>
134                                 <xsl:when test="@t='yes'">
135                                         <para style="terp_tblheader_Details_Right_bold">
136                                                 <xsl:value-of select="."/>
137                                         </para>
138                                 </xsl:when>
139                                 <xsl:otherwise>
140                                         <para style="terp_tblheader_General">
141                                                 <xsl:value-of select="."/>
142                                         </para>
143                                 </xsl:otherwise>
144                         </xsl:choose>
145                 </td>
146         </xsl:template>
147
148 </xsl:stylesheet>