Merge branch 'master' of https://github.com/odoo/odoo
[odoo/odoo.git] / addons / report / views / layouts.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4 <template id="layout" inherit_id="web.layout" primary="True">
5     <!-- Add report attributes -->
6     <xpath expr="//html" position="attributes">
7         <attribute name="t-att-data-report-margin-top">data_report_margin_top if data_report_margin_top else None</attribute>
8         <attribute name="t-att-data-report-header-spacing">data_report_header_spacing if data_report_header_spacing else None</attribute>
9         <attribute name="t-att-data-report-dpi">data_report_dpi if data_report_dpi else None</attribute>
10     </xpath>
11     <!-- Add report style -->
12     <xpath expr="//head" position="inside">
13         <link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
14         <link href="/website/static/src/css/website.css" rel="stylesheet"/>
15         <link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
16         <style type="text/css">
17             <t t-call="report.style"/>
18         </style>
19     </xpath>
20     <!-- Remove conflicting style -->
21     <xpath expr="//head/link[@href='/web/static/src/css/full.css']" position="replace"></xpath>
22 </template>
23
24 <template id="html_container">
25     <t t-set="body_classname" t-value="'container'"/>
26     <t t-call="report.layout">
27         <t t-raw="0"/>
28     </t>
29 </template>
30
31 <template id="style">
32     body {
33         color: #000 !important;
34     }
35     .border-black td {
36         border-top: 1px solid black !important;
37     }
38     .table-condensed > thead > tr > th {
39         border-bottom: 1px solid black !important;
40     }
41     .zero_min_height {
42         min-height: 0px !important;
43     }
44 </template>
45
46 <template id="external_layout">
47     <!-- Multicompany -->
48     <t t-if="o and 'company_id' in o">
49         <t t-set="company" t-value="o.company_id"></t>
50     </t>
51     <t t-if="not o or not 'company_id' in o">
52         <t t-set="company" t-value="res_company"></t>
53     </t>
54
55     <t t-call="report.external_layout_header" />
56     <t t-raw="0" />
57     <t t-call="report.external_layout_footer" />
58 </template>
59
60 <template id="external_layout_header">
61     <div class="header">
62         <div class="row">
63             <div class="col-xs-3">
64                 <img t-if="company.logo" t-att-src="'data:image/png;base64,%s' % company.logo" style="max-height: 45px;"/>
65             </div>
66             <div class="col-xs-9 text-right" style="margin-top:20px;" t-field="company.rml_header1"/>
67         </div>
68         <div class="row zero_min_height">
69             <div class="col-xs-12">
70                 <div style="border-bottom: 1px solid black;"></div>
71             </div>
72         </div>
73         <div class="row">
74             <div class="col-xs-3">
75                 <div t-field="company.partner_id" 
76                     t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'
77                     style="border-bottom: 1px solid black;"/>
78             </div>
79         </div>
80     </div>
81 </template>
82
83 <template id="external_layout_footer">
84     <div class="footer">
85         <div class="text-center" style="border-top: 1px solid black;">
86             <ul t-if="not company.custom_footer" class="list-inline">
87                 <li t-if="company.phone">Phone: <span t-field="company.phone"/></li>
88
89                 <li t-if="company.fax and company.phone">&amp;bull;</li>
90                 <li t-if="company.fax">Fax: <span t-field="company.fax"/></li>
91
92                 <li t-if="company.email">&amp;bull;</li>
93                 <li t-if="company.email">Email: <span t-field="company.email"/></li>
94
95                 <li t-if="company.website">&amp;bull;</li>
96                 <li t-if="company.website">Website: <span t-field="company.website"/></li>
97             </ul>
98
99             <t t-if="company.custom_footer">
100                 <span t-raw="company.rml_footer"/>
101             </t>
102
103             <ul class="list-inline">
104                 <li>Page:</li>
105                 <li><span class="page"/></li>
106                 <li>/</li>
107                 <li><span class="topage"/></li>
108             </ul>
109         </div>
110     </div>      
111 </template>
112
113 <template id="internal_layout">
114     <!-- Multicompany -->
115     <t t-if="o and 'company_id' in o">
116         <t t-set="company" t-value="o.company_id"></t>
117     </t>
118     <t t-if="not o or not 'company_id' in o">
119         <t t-set="company" t-value="res_company"></t>
120     </t>
121
122     <div class="header">
123         <div class="row">
124             <div class="col-xs-3">
125                 <span t-esc="time.strftime('%Y-%m-%d')"/>
126                 <span t-esc="time.strftime('%H:%M')"/>
127             </div>
128             <div class="col-xs-2 col-xs-offset-2 text-center">
129                 <span t-esc="company.name"/>
130             </div>
131             <div class="col-xs-2 col-xs-offset-3 text-right">
132                 <ul class="list-inline">
133                     <li><span class="page"/></li>
134                     <li>/</li>
135                     <li><span class="topage"/></li>
136                 </ul>
137             </div>
138         </div>
139     </div>
140     <t t-raw="0" />
141 </template>
142
143 <template id="minimal_layout">
144     <t t-raw="'&lt;base href=%s&gt;' % base_url"/>
145     &lt;!DOCTYPE html&gt;
146     <html style="height: 0;">
147         <head>
148             <link href="/report/static/src/css/reset.min.css" rel="stylesheet"/>
149             <link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
150             <link href="/website/static/src/css/website.css" rel="stylesheet"/>
151             <link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
152             <style type='text/css'><t t-raw="css"/></style>
153             <t t-if="subst is True">
154                 <script src='/report/static/src/js/subst.js'></script>
155             </t>
156         </head>
157         <body class="container" onload="subst()">
158             <t t-raw="body"/>
159         </body>
160     </html>
161 </template>
162
163 </data>
164 </openerp>