summaryrefslogtreecommitdiff
path: root/addons/web/views/report_templates.xml
blob: 573d1f1a161f78890735425e1dbc224d3a8934bd (plain)
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Assets for reports -->

    <template id="report_assets_common">
        <t t-call="web._assets_helpers">
          <link rel="stylesheet" type="text/scss" href="/web/static/src/scss/bootstrap_overridden_report.scss"/>
        </t>

        <t t-call="web._assets_bootstrap"/>

        <link href="/base/static/src/css/description.css" rel="stylesheet" type="text/css"/>

        <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/fonts.scss"/>

        <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"/>
        <link rel="stylesheet" type="text/scss" href="/web/static/src/scss/asset_styles_company_report.scss"/>

        <script type="text/javascript" src="/web/static/src/js/services/session.js"/>
        <script type="text/javascript" src="/web/static/src/js/public/public_root.js"/>
        <script type="text/javascript" src="/web/static/src/js/public/public_root_instance.js"/>
        <script type="text/javascript" src="/web/static/src/js/public/public_widget.js"/>
        <script type="text/javascript" src="/web/static/src/js/report/utils.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>

    <!-- Private templates used internally by reports -->

    <template id="report_layout" name="Report layout">&lt;!DOCTYPE html&gt;
        <html t-att-lang="lang and lang.replace('_', '-')"
              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.report_assets_common" t-js="false"/>
                <t t-call-assets="web.assets_common" t-css="false"/>
                <t t-call-assets="web.report_assets_common" t-css="false"/>
            </head>
            <body t-att-class="'container' if not full_width else 'container-fluid'">
                <div id="wrapwrap">
                    <main>
                        <t t-raw="0"/>
                    </main>
                </div>
            </body>
        </html>
    </template>

    <template id="report_preview_layout" name="Report layout">&lt;!DOCTYPE html&gt;
        <html t-att-lang="lang and lang.replace('_', '-')"
              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.report_assets_common" t-js="false"/>
                <t t-call-assets="web.assets_common" t-css="false"/>
                <style>
                    <t t-raw="preview_css"/>

                    /**
                        Some css is overridden as it doesn't work properly in the preview.
                        Before generating 'real' reports, a lot of processing is applied. It is therefore quite
                        complicated to have an almost exact replica of the pdf report.
                        This changes down here are hacks to make the preview look as good as possible.
                    **/

                    /** The footers are not at the bottom of the page, so we push them down. **/
                    .o_background_footer  {
                        margin-top: 270px !important;
                    }
                    .o_standard_footer {
                        margin-top: 190px !important;
                    }
                    .o_boxed_footer {
                         margin-top: 270px !important;
                    }
                    .o_clean_footer {
                         margin-top: 160px !important;
                    }

                    /** Avoid image overflowing and creating a scrollbar **/
                    .o_background_header {
                        min-width: initial !important;
                    }

                    /** This rule is overridden in web/report.scss to hack around whtml2pdf
                        Simply set it to its default value so it works properly in preview **/
                    .col-auto{
                        -webkit-box-flex: 0 !important;
                        -webkit-flex: 0 0 auto !important;
                        flex: 0 0 auto !important;
                        width: auto !important;
                        max-width: 100% !important;
                    }

                </style>
            </head>
            <body t-att-class="'container' if not full_width else 'container-fluid'">
                <div id="wrapwrap">
                        <t t-raw="0"/>
                </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="html_preview_container">
        <t t-set="body_classname" t-value="'container'"/>
        <t t-call="web.report_preview_layout">
            <t t-raw="0"/>
        </t>
    </template>


    <template id="report_invoice_wizard_preview">
        <t t-call="web.html_preview_container">
           <t t-call="web.external_layout">
                   <div class="pt-5">
                       <div class="address row">
                           <div name="address" class="col-md-5 ml-auto">
                               <address>
                                   <address class="mb-0" itemscope="itemscope"
                                            itemtype="http://schema.org/Organization">
                                       <div>
                                           <span itemprop="name">Deco Addict</span>
                                       </div>
                                       <div itemprop="address" itemscope="itemscope"
                                            itemtype="http://schema.org/PostalAddress">
                                           <div class="d-flex align-items-baseline">
                                               <span class="w-100 o_force_ltr" itemprop="streetAddress">77 Santa Barbara
                                                   Rd<br/>Pleasant Hill CA 94523<br/>United States</span>
                                           </div>
                                       </div>
                                   </address>
                               </address>
                           </div>
                       </div>
                   </div>
                   <div class="page">
                       <h2>
                           <span>Invoice</span>
                           <span>INV/2020/07/0003</span>
                       </h2>
                       <div id="informations" class="row mt32 mb32">
                           <div class="col-auto mw-100 mb-2" name="invoice_date">
                               <strong>Invoice Date:</strong>
                               <p class="m-0">07/08/2020</p>
                           </div>
                           <div class="col-auto mw-100 mb-2" name="due_date">
                               <strong>Due Date:</strong>
                               <p class="m-0">08/07/2020</p>
                           </div>
                       </div>
                       <table class="table table-sm o_main_table" name="invoice_line_table">
                           <thead>
                               <tr>
                                   <th name="th_description" class="text-left"><span>Description</span></th>
                                   <th name="th_quantity" class="text-right"><span>Quantity</span></th>
                                   <th name="th_priceunit" class="text-right d-none d-md-table-cell"><span>Unit Price</span></th>
                                   <th name="th_taxes" class="text-left d-none d-md-table-cell"><span>Taxes</span></th>
                                   <th name="th_subtotal" class="text-right">
                                       <span>Amount</span>
                                   </th>
                               </tr>
                           </thead>
                           <tbody class="invoice_tbody">
                               <tr>
                                   <td name="account_invoice_line_name"><span>[FURN_8999] Three-Seat Sofa<br/>
                                       Three Seater Sofa with Lounger in Steel Grey Colour</span></td>
                                   <td class="text-right">
                                       <span>5.000</span>
                                   </td>
                                   <td class="text-right d-none d-md-table-cell">
                                       <span class="text-nowrap">1,500.00</span>
                                   </td>
                                   <td class="text-left d-none d-md-table-cell">
                                       <span id="line_tax_ids">15.00%</span>
                                   </td>
                                   <td class="text-right o_price_total">
                                       <span class="text-nowrap">$ <span class="oe_currency_value">7,500.00</span></span>
                                   </td>
                               </tr>
                               <tr>
                                   <td name="account_invoice_line_name"><span>[FURN_8220] Four Person Desk<br/>
                                       Four person modern office workstation</span></td>
                                   <td class="text-right">
                                       <span>5.000</span>
                                   </td>
                                   <td class="text-right d-none d-md-table-cell">
                                       <span class="text-nowrap">23,500.00</span>
                                   </td>
                                   <td class="text-left d-none d-md-table-cell">
                                       <span id="line_tax_ids">15.00%</span>
                                   </td>
                                   <td class="text-right o_price_total">
                                       <span class="text-nowrap">$ <span class="oe_currency_value">117,500.00</span></span>
                                   </td>
                               </tr>
                           </tbody>
                       </table>
                       <div class="clearfix">
                           <div id="total" class="row">
                               <div class="col-sm-7 col-md-6 ml-auto">
                                   <table class="table table-sm" style="page-break-inside: avoid;">
                                       <tbody><tr class="border-black o_subtotal" style="">
                                           <td><strong>Subtotal</strong></td>
                                           <td class="text-right">
                                               <span>$ <span class="oe_currency_value">125,000.00</span></span>
                                           </td>
                                       </tr>
                                           <tr style="">
                                               <td><span class="text-nowrap">Tax 15%</span></td>
                                               <td class="text-right o_price_total">
                                                   <span class="text-nowrap">$ 18,750.00</span>
                                               </td>
                                           </tr>
                                           <tr class="border-black o_total">
                                               <td><strong>Total</strong></td>
                                               <td class="text-right">
                                                   <span class="text-nowrap">$ <span class="oe_currency_value">
                                                       143,750.00</span></span>
                                               </td>
                                           </tr>
                                       </tbody></table>
                               </div>
                           </div>
                       </div>
                       <p>
                           Please use the following communication for your payment : <b><span>
                           INV/2020/07/0003</span></b>
                       </p>
                       <p name="payment_term">
                           <span>Payment terms: 30 Days</span>
                       </p>
                   </div>
           </t>
        </t>
    </template>

    <template id="minimal_layout">
        &lt;!DOCTYPE html&gt;
        <t t-raw="'&lt;base href=%s&gt;' % 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('&amp;');
                            for (var i in x) {
                                var z = x[i].split('=', 2);
                                vars[z[0]] = unescape(z[1]);
                            }
                            var x = ['sitepage', 'sitepages', 'section', 'subsection', 'subsubsection'];
                            var z = {'sitepage': 'page', 'sitepages': 'topage'};
                            for (var i in x) {
                                var y = document.getElementsByClassName(z[x[i]] || x[i])
                                for (var j=0; j&lt;y.length; ++j)
                                    y[j].textContent = vars[x[i]];
                            }

                            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 t-attf-class="o_company_#{company.id}_layout header" t-att-style="report_header_style">
            <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 t-attf-class="o_company_#{company.id}_layout 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 t-attf-class="o_company_#{company.id}_layout 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 class="o_force_ltr" 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 t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style">
            <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="float-right 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 t-attf-class="article o_report_layout_boxed o_company_#{company.id}_layout" 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')">
            <div class="pt-5">
                <!-- This div ensures that the address is not cropped by the header. -->
                <t t-call="web.address_layout"/>
            </div>
            <t t-raw="0"/>
        </div>

        <div t-attf-class="footer o_boxed_footer o_company_#{company.id}_layout">
            <div class="text-center">
                <ul class="list-inline">
                    <li t-if="company.phone" class="list-inline-item"><span class="o_force_ltr" t-field="company.phone"/></li>
                    <li t-if="company.email" class="list-inline-item"><span t-field="company.email"/></li>
                    <li t-if="company.website" class="list-inline-item"><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 t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style">
            <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 class="o_force_ltr" 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 t-attf-class="article o_report_layout_clean o_company_#{company.id}_layout"  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 t-attf-class="footer o_clean_footer o_company_#{company.id}_layout">
            <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 t-attf-class="header o_company_#{company.id}_layout" t-att-style="report_header_style">
            <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 t-attf-class="article o_report_layout_standard o_company_#{company.id}_layout"  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')">
            <div class="pt-5">
                <!-- This div ensures that the address is not cropped by the header. -->
                <t t-call="web.address_layout"/>
            </div>
            <t t-raw="0"/>
        </div>

        <div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout">
            <div class="text-center" style="border-top: 1px solid black;">
                <ul class="list-inline mb4">
                    <!-- using the list-inline-item class from bootstrap causes weird behaviours in pdf report
                         adding d-inline class fixes the problem-->
                    <li t-if="company.phone" class="list-inline-item d-inline"><span class="o_force_ltr" t-field="company.phone"/></li>
                    <li t-if="company.email" class="list-inline-item d-inline"><span t-field="company.email"/></li>
                    <li t-if="company.website" class="list-inline-item d-inline"><span t-field="company.website"/></li>
                    <li t-if="company.vat" class="list-inline-item d-inline"><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 and o.company_id.sudo()">
                <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-else="else" t-call="web.external_layout_standard"><t t-raw="0"/></t>

    </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 and o.company_id.sudo()">
                <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">
            <t t-if="not o" t-set="o" t-value="doc"/>
            <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-set="company" t-value="env.company"/>
        <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-set="company" t-value="env.company"/>
        <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>

    <template id="styles_company_report">
        <t t-foreach="company_ids" t-as="company" t-translation="off">
            <t t-set="font" t-value="company.font or 'Lato'" />
            <t t-set="primary" t-value="company.primary_color or 'black'" />
            <t t-set="secondary" t-value="company.secondary_color or 'black'" />
            <t t-set="layout" t-value="company.external_report_layout_id.key or 'web.external_layout_standard'" />
                .o_company_<t t-esc='company.id'/>_layout {
                font-family: '<t t-esc="font" />';

            <t t-if="layout == 'web.external_layout_background'">
                .o_background_header {
                    h3 {
                        color: <t t-esc='primary'/>;
                    }
                }
                &amp;.o_background_footer {
                    ul {
                        li {
                            color: <t t-esc='secondary'/>;
                        }
                    }
                }
                &amp;.o_report_layout_background {
                   strong {
                        color: <t t-esc='secondary'/>;
                    }
                    h2 {
                        color: <t t-esc='primary'/>;
                    }
                    thead tr th {
                        color: <t t-esc='secondary'/>;
                    }
                }
                .row > div > table,
                div#total table {
                    &amp;:first-child,
                    &amp;:last-child,
                    &amp;.o_subtotal,
                    &amp;.o_total {
                        strong {
                            color: <t t-esc='primary'/>;
                        }
                    }
                }
            </t>
            <t t-elif="layout == 'web.external_layout_boxed'">
                &amp;.o_report_layout_boxed {
                    #total strong {
                        color: <t t-esc='primary'/>;
                    }
                    #informations strong {
                        color: <t t-esc='secondary'/>;
                    }
                    h2 span {
                        color: <t t-esc='primary'/>;
                    }
                    table {
                        thead {
                            tr th {
                                color: <t t-esc='secondary'/>;
                            }
                        }
                        tbody tr td {
                            &amp;.o_line_section td {
                                    background-color: rgba(<t t-esc='primary'/>, 0.7);
                                }
                            &amp;.is-subtotal,
                                td.o_price_total {
                                    background-color: rgba(<t t-esc='secondary'/>, 0.1);
                                }
                        }
                    }
                }
                .row > div > table,
                div#total table {
                    tr {
                        &amp;.o_total td {
                            background-color: rgba(<t t-esc='primary'/>, 0.9);
                        }
                    }
                }
            </t>
            <t t-elif="layout == 'web.external_layout_clean'" >
                &amp;.o_clean_footer {
                    border-top: 3px solid <t t-esc='secondary'/>;
                    h4 {
                        color: <t t-esc='secondary'/>;
                    }
                    .pagenumber {
                        border: 3px solid <t t-esc='primary'/>;
                        background-color: <t t-esc='secondary'/>;
                    }
                }
                &amp;.o_report_layout_clean {
                    h1, h2, h3 {
                        color: <t t-esc='primary'/>;
                    }
                    strong {
                        color: <t t-esc='secondary'/>;
                    }
                    table {
                       thead {
                           color: <t t-esc='secondary'/>;
                           tr th {
                                border-top: 3px solid <t t-esc='secondary'/> !important;
                            }
                        }
                        tbody {
                            tr:last-child td {
                                border-bottom: 3px solid <t t-esc='secondary'/>;
                            }
                        }
                    }
                    #total {
                        strong {
                            color: <t t-esc='secondary'/>;
                        }
                    }
                }
            </t>
            <t t-elif="layout == 'web.external_layout_standard'">
                &amp;.o_report_layout_standard {
                    h2 {
                        color: <t t-esc='primary'/>;
                    }
                    #informations strong {
                        color: <t t-esc='secondary'/>;
                    }
                    #total strong{
                        color: <t t-esc='primary'/>;
                    }
                    table {
                        thead {
                            color: <t t-esc='secondary'/>;
                        }
                    }
                }
            </t>
            }
        </t>
    </template>

    <record id="action_report_internalpreview" model="ir.actions.report">
        <field name="name">Preview Internal Report</field>
        <field name="model">res.company</field>
        <field name="report_type">qweb-pdf</field>
        <field name="report_name">web.preview_internalreport</field>
        <field name="report_file">web.preview_internalreport</field>
        <field name="binding_model_id" ref="model_res_company"/>
        <field name="binding_type">report</field>
    </record>
    <record id="action_report_externalpreview" model="ir.actions.report">
        <field name="name">Preview External Report</field>
        <field name="model">res.company</field>
        <field name="report_type">qweb-pdf</field>
        <field name="report_name">web.preview_externalreport</field>
        <field name="report_file">web.preview_externalreport</field>
        <field name="binding_model_id" ref="model_res_company"/>
        <field name="binding_type">report</field>
    </record>
</odoo>