/
report_templates.xml
443 lines (400 loc) · 20.2 KB
/
report_templates.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Assets for reports -->
<template id="report_assets_common">
<t t-call="web._assets_helpers"><t t-set="no_bs_vars" t-value="True"/></t>
<!-- FIXME web_editor ? -->
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/bootstrap_overridden.scss"/>
<t t-call="web._assets_bootstrap"/>
<link href="/base/static/src/css/description.css" rel="stylesheet" type="text/css"/>
<!-- FIXME web_editor ? -->
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/web_editor.common.scss"/>
<link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/report.scss"/>
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/layout_standard.scss"/>
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/layout_background.scss"/>
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/layout_boxed.scss"/>
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/layout_clean.scss"/>
<script type="text/javascript" src="/web/static/src/js/services/session.js"/>
<script type="text/javascript" src="/web/static/src/js/report/utils.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/content/body_manager.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/root_widget.js"/>
<script type="text/javascript" src='/web/static/src/js/report/report.js' />
</template>
<template id="report_assets_pdf">
<link href="/web/static/src/css/reset.min.css" rel="stylesheet"/>
</template>
<template id="report_assets_editor">
<t t-call="web._assets_helpers"/>
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/report.editor.scss"/>
<script type="text/javascript" src="/web/static/src/js/services/session.js"/>
<script type="text/javascript" src='/web/static/src/js/report/report.editor.js' />
</template>
<!-- Private templates used internally by reports -->
<template id="report_layout" name="Report layout"><!DOCTYPE html>
<html t-att-lang="lang and lang.replace('_', '-')"
t-att-data-editable="'1' if editable else None"
t-att-data-translatable="'1' if translatable else None"
t-att-data-edit_translations="'1' if edit_translations else None"
t-att-data-main-object="repr(main_object) if editable else None"
t-att-data-report-margin-top="data_report_margin_top"
t-att-data-report-header-spacing="data_report_header_spacing"
t-att-data-report-dpi="data_report_dpi"
t-att-data-report-landscape="data_report_landscape"
t-att-web-base-url="web_base_url">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1"/>
<title><t t-esc="title or 'Odoo Report'"/></title>
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.report_assets_common" t-js="false"/>
<t t-if="editable">
<t t-call-assets="web_editor.summernote" t-js="false"/>
<t t-call-assets="web_editor.assets_editor" t-js="false"/>
<t t-call-assets="web.report_assets_editor" t-js="false"/>
</t>
<t t-call-assets="web.assets_common" t-css="false"/>
<t t-call-assets="web.report_assets_common" t-css="false"/>
<t t-if="editable">
<t t-call-assets="web_editor.summernote" t-css="false"/>
<t t-call-assets="web_editor.assets_editor" t-css="false"/>
<t t-call-assets="web.report_assets_editor" t-css="false"/>
<script type="text/javascript" src="/web_editor/static/src/js/iframe.js"></script>
<script t-if="enable_editor and inline_mode" type="text/javascript" src="/web_editor/static/src/js/inline.js"></script>
</t>
</head>
<body>
<div id="wrapwrap">
<main t-att-class="'container' if not full_width else 'container-fluid'">
<t t-raw="0"/>
</main>
</div>
</body>
</html>
</template>
<template id="html_container">
<t t-set="body_classname" t-value="'container'"/>
<t t-call="web.report_layout">
<t t-raw="0"/>
</t>
</template>
<template id="minimal_layout">
<!DOCTYPE html>
<t t-raw="'<base href=%s>' % base_url"/>
<html style="height: 0;">
<head>
<t t-call-assets="web.report_assets_pdf" t-js="false"/>
<t t-call-assets="web.report_assets_common" t-js="false"/>
<t t-call-assets="web.report_assets_pdf" t-css="false"/>
<meta charset="utf-8"/>
<t t-set="subst_needed" t-value="subst is True"/>
<t t-if="subst_needed">
<script>
function subst() {
var vars = {};
var x = document.location.search.substring(1).split('&');
for (var i in x) {
var z = x[i].split('=', 2);
vars[z[0]] = unescape(z[1]);
}
var fromPage = document.getElementsByClassName('page');
for(var j = 0; j<fromPage.length; j++)
fromPage[j].textContent = vars['sitepage'];
var toPage = document.getElementsByClassName('topage');
for(var j = 0; j<toPage.length; j++)
toPage[j].textContent = vars['sitepages'];
var index = vars['webpage'].split('.', 4)[3]
var header = document.getElementById('minimal_layout_report_headers');
if(header !== null){
var companyHeader = header.children[index];
header.textContent = '';
header.appendChild(companyHeader);
}
var footer = document.getElementById('minimal_layout_report_footers');
if(footer !== null){
var companyFooter = footer.children[index];
footer.textContent = '';
footer.appendChild(companyFooter);
}
}
</script>
</t>
</head>
<body class="container" t-att-onload="subst_needed and 'subst()'">
<t t-raw="body"/>
</body>
</html>
</template>
<!-- External layouts styles -->
<template id="address_layout">
<t t-set="colclass" t-value="('col-md-5' if report_type == 'html' else 'col-5') + ' ml-auto'"/>
<t t-if="address">
<div class="address row">
<t t-if="information_block">
<t t-set="colclass" t-value="'col-5 offset-1'"/>
<div name="information_block" class="col-6">
<t t-raw="information_block"/>
</div>
</t>
<div name="address" t-att-class="colclass">
<t t-raw="address"/>
</div>
</div>
</t>
</template>
<template id="external_layout_background">
<div class="header">
<div class="o_background_header">
<div class="float-right">
<h3 class="mt0 text-right" t-field="company.report_header"/>
</div>
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" class="float-left" alt="Logo"/>
<div class="float-left company_address">
<div>
<strong t-field="company.partner_id.name"/>
</div>
<span t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/>
</div>
<div class="clearfix mb8"/>
</div>
</div>
<div class="article o_report_layout_background" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_background_footer">
<div class="text-center">
<ul class="list-inline">
<li t-if="company.phone" class="list-inline-item"><i class="fa fa-phone" role="img" aria-label="Phone" title="Phone"/> <span t-field="company.phone"/></li>
<li t-if="company.email" class="list-inline-item"><i class="fa fa-at" role="img" aria-label="Email" title="Email"/> <span t-field="company.email"/></li>
<li t-if="company.website" class="list-inline-item"><i class="fa fa-globe" role="img" aria-label="Website" title="Website"/> <span t-field="company.website"/></li>
<li t-if="company.vat" class="list-inline-item"><i class="fa fa-building-o" role="img" aria-label="Fiscal number"/><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
</ul>
<div t-field="company.report_footer"/>
<div t-if="report_type == 'pdf'" class="text-muted">
Page:
<span class="page"/>
of
<span class="topage"/>
</div>
</div>
</div>
</template>
<template id="external_layout_boxed">
<div class="header">
<div class="o_boxed_header">
<div class="row mb8">
<div class="col-6">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
</div>
<div class="col-6 text-right mb4">
<h4 class="mt0" t-field="company.report_header"/>
<div name="company_address" class="mb4">
<span class="company_address" t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/>
</div>
</div>
</div>
</div>
</div>
<div class="article o_report_layout_boxed" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_boxed_footer">
<div class="text-center">
<ul class="list-inline">
<li t-if="company.phone" class="list-inline-item">Tel: <span t-field="company.phone"/></li>
<li t-if="company.email" class="list-inline-item">Mail: <span t-field="company.email"/></li>
<li t-if="company.website" class="list-inline-item">Web: <span t-field="company.website"/></li>
<li t-if="company.vat" class="list-inline-item"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
</ul>
<div t-field="company.report_footer"/>
<div t-if="report_type == 'pdf'">
Page: <span class="page"/> / <span class="topage"/>
</div>
</div>
</div>
</template>
<template id="external_layout_clean">
<div class="header">
<div class="o_clean_header">
<div class="row">
<div class="col-6">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
</div>
<div class="col-5 offset-1" name="company_address">
<ul class="list-unstyled">
<strong><li t-if="company.name"><span t-field="company.name"/></li></strong>
<li t-if="company.vat"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
<li t-if="company.phone">Tel: <span t-field="company.phone"/></li>
<li t-if="company.email"><span t-field="company.email"/></li>
<li t-if="company.website"><span t-field="company.website"/></li>
</ul>
</div>
</div>
</div>
</div>
<div class="article o_report_layout_clean" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_clean_footer">
<div class="row mt8">
<div class="col-3">
<span t-field="company.report_footer"/>
</div>
<div class="col-4 text-right">
<span class="company_address" t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address"], "no_marker": true}'/>
</div>
<div class="col-4">
<h4 class="mt0 mb0 text-uppercase" t-field="company.report_header"/>
</div>
<div class="col-1">
<ul t-if="report_type == 'pdf'" class="list-inline pagenumber float-right text-center">
<li class="list-inline-item"><strong><span class="page"/></strong></li>
</ul>
</div>
</div>
</div>
</template>
<template id="external_layout_standard">
<div class="header">
<div class="row">
<div class="col-3 mb4">
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)" style="max-height: 45px;" alt="Logo"/>
</div>
<div class="col-9 text-right" style="margin-top:22px;" t-field="company.report_header" name="moto"/>
</div>
<div t-if="company.logo or company.report_header" class="row zero_min_height">
<div class="col-12">
<div style="border-bottom: 1px solid black;"/>
</div>
</div>
<div class="row">
<div class="col-6" name="company_address">
<div t-field="company.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'
/>
</div>
</div>
</div>
<div class="article o_report_layout_standard" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-call="web.address_layout"/>
<t t-raw="0"/>
</div>
<div class="footer o_standard_footer">
<div class="text-center" style="border-top: 1px solid black;">
<ul class="list-inline mb4">
<li t-if="company.phone" class="list-inline-item">Phone: <span t-field="company.phone"/></li>
<li t-if="company.email" class="list-inline-item">Email: <span t-field="company.email"/></li>
<li t-if="company.website" class="list-inline-item">Web: <span t-field="company.website"/></li>
<li t-if="company.vat" class="list-inline-item"><t t-esc="company.country_id.vat_label or 'Tax ID'"/>: <span t-field="company.vat"/></li>
</ul>
<div name="financial_infos">
<span t-field="company.report_footer"/>
</div>
<div t-if="report_type == 'pdf'" class="text-muted">
Page: <span class="page"/> / <span class="topage"/>
</div>
</div>
</div>
</template>
<!-- Public api: layout to t-call from reports -->
<template id="external_layout">
<t t-if="not o" t-set="o" t-value="doc"/>
<t t-if="not company">
<!-- Multicompany -->
<t t-if="company_id">
<t t-set="company" t-value="company_id"/>
</t>
<t t-elif="o and 'company_id' in o">
<t t-set="company" t-value="o.company_id.sudo()"/>
</t>
<t t-else="else">
<t t-set="company" t-value="res_company"/>
</t>
</t>
<t t-if="company.external_report_layout_id" t-call="{{company.external_report_layout_id.key}}"><t t-raw="0"/></t>
<t t-elif="not company.external_report_layout_id" t-call="{{'web.external_layout_standard'}}"><t t-raw="0"/></t>
<t t-else="else" t-raw="0"/>
</template>
<template id="internal_layout">
<t t-if="not o" t-set="o" t-value="doc"/>
<t t-if="not company">
<!-- Multicompany -->
<t t-if="company_id">
<t t-set="company" t-value="company_id"/>
</t>
<t t-elif="o and 'company_id' in o">
<t t-set="company" t-value="o.company_id.sudo()"/>
</t>
<t t-else="else">
<t t-set="company" t-value="res_company"/>
</t>
</t>
<div class="header">
<div class="row">
<div class="col-3">
<span t-esc="context_timestamp(datetime.datetime.now()).strftime('%Y-%m-%d %H:%M')"/>
</div>
<div class="col-2 offset-2 text-center">
<span t-esc="company.name"/>
</div>
<div class="col-2 offset-3 text-right">
<ul class="list-inline">
<li class="list-inline-item"><span class="page"/></li>
<li class="list-inline-item">/</li>
<li class="list-inline-item"><span class="topage"/></li>
</ul>
</div>
</div>
</div>
<div class="article" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-raw="0"/>
</div>
</template>
<template id="basic_layout">
<t t-call="web.html_container">
<div class="article" t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id" t-att-data-oe-lang="o and o.env.context.get('lang')">
<t t-raw="0"/>
</div>
</t>
</template>
<!-- Customize the company form view by adding paperformat field as well as demo reports -->
<!-- Demo reports definition -->
<template id="preview_internalreport">
<t t-call="web.html_container">
<t t-set="o" t-value="res_company"/>
<t t-call="web.internal_layout">
<div class="page">
<p>This is a sample of an internal report.</p>
</div>
</t>
</t>
</template>
<template id="preview_externalreport">
<t t-call="web.html_container">
<t t-set="o" t-value="res_company"/>
<t t-call="web.external_layout">
<div class="page">
<p>This is a sample of an external report.</p>
</div>
</t>
</t>
</template>
<report id="action_report_internalpreview"
model="res.company"
name="web.preview_internalreport"
file="web.preview_internalreport"
string="Preview Internal Report"
report_type="qweb-pdf"/>
<report id="action_report_externalpreview"
model="res.company"
name="web.preview_externalreport"
file="web.preview_externalreport"
string="Preview External Report"
report_type="qweb-pdf"/>
</odoo>