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
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_my_home_menu_sale" name="Portal layout : sales menu entries" inherit_id="portal.portal_breadcrumbs" priority="20">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'quote' or sale_order and sale_order.state in ('sent', 'cancel')" t-attf-class="breadcrumb-item #{'active ' if not sale_order else ''}">
<a t-if="sale_order" t-attf-href="/my/quotes?{{ keep_query() }}">Quotations</a>
<t t-else="">Quotations</t>
</li>
<li t-if="page_name == 'order' or sale_order and sale_order.state not in ('sent', 'cancel')" t-attf-class="breadcrumb-item #{'active ' if not sale_order else ''}">
<a t-if="sale_order" t-attf-href="/my/orders?{{ keep_query() }}">Sales Orders</a>
<t t-else="">Sales Orders</t>
</li>
<li t-if="sale_order" class="breadcrumb-item active">
<span t-field="sale_order.type_name"/>
<t t-esc="sale_order.name"/>
</li>
</xpath>
</template>
<template id="portal_my_home_sale" name="Show Quotations / Sales Orders" customize_show="True" inherit_id="portal.portal_my_home" priority="20">
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Quotations</t>
<t t-set="url" t-value="'/my/quotes'"/>
<t t-set="placeholder_count" t-value="'quotation_count'"/>
</t>
<t t-call="portal.portal_docs_entry">
<t t-set="title">Sales Orders</t>
<t t-set="url" t-value="'/my/orders'"/>
<t t-set="placeholder_count" t-value="'order_count'"/>
</t>
</xpath>
</template>
<template id="portal_my_quotations" name="My Quotations">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Quotations</t>
</t>
<t t-if="not quotations">
<p>There are currently no quotations for your account.</p>
</t>
<t t-if="quotations" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>Quotation #</th>
<th class="text-right">Quotation Date</th>
<th class="text-right">Valid Until</th>
<th class="text-center"/>
<th class="text-right">Total</th>
</tr>
</thead>
<t t-foreach="quotations" t-as="quotation">
<tr>
<td><a t-att-href="quotation.get_portal_url()"><t t-esc="quotation.name"/></a></td>
<td class="text-right"><span t-field="quotation.date_order"/></td>
<td class="text-right"><span t-field="quotation.validity_date"/></td>
<td class="text-center">
<span t-if="quotation.state == 'cancel'" class="badge badge-pill badge-secondary"><i class="fa fa-fw fa-remove"/> Cancelled</span>
<span t-if="quotation.is_expired" class="badge badge-pill badge-secondary"><i class="fa fa-fw fa-clock-o"/> Expired</span>
</td>
<td class="text-right">
<span t-field="quotation.amount_total"/>
</td>
</tr>
</t>
</t>
</t>
</template>
<template id="portal_my_orders" name="My Sales Orders">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Sales Orders</t>
</t>
<t t-if="not orders">
<p>There are currently no orders for your account.</p>
</t>
<t t-if="orders" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>
<span class='d-none d-md-inline'>Sales Order #</span>
<span class='d-block d-md-none'>Ref.</span>
</th>
<th class="text-right">Order Date</th>
<th class="text-center"/>
<th class="text-right">Total</th>
</tr>
</thead>
<t t-foreach="orders" t-as="order">
<tr>
<td><a t-att-href="order.get_portal_url()"><t t-esc="order.name"/></a></td>
<td class="text-right">
<span t-field="order.date_order" t-options="{'widget': 'date'}"/>&nbsp;
<span class='d-none d-md-inline' t-field="order.date_order" t-options="{'time_only': True}"/>
</td>
<td class="text-center">
<span t-if="order.state == 'done'" class="badge badge-pill badge-success">
<i class="fa fa-fw fa-check" role="img" aria-label="Done" title="Done"/>Done
</span>
</td>
<td class="text-right"><span t-field="order.amount_total"/></td>
</tr>
</t>
</t>
</t>
</template>
<!-- Complete page of the sale_order -->
<template id="sale_order_portal_template" name="Sales Order Portal Template" inherit_id="portal.portal_sidebar" primary="True">
<xpath expr="//div[hasclass('o_portal_sidebar')]" position="inside">
<t t-set="o_portal_fullwidth_alert" groups="sales_team.group_sale_salesman">
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#model=%s&id=%s&action=%s&view_type=form' % (sale_order._name, sale_order.id, action.id)"/>
</t>
</t>
<div class="row mt16 o_portal_sale_sidebar">
<!-- Sidebar -->
<t t-call="portal.portal_record_sidebar">
<t t-set="classes" t-value="'col-lg-auto d-print-none'"/>
<t t-set="title">
<h2 class="mb-0"><b t-field="sale_order.amount_total" data-id="total_amount"/> </h2>
</t>
<t t-set="entries">
<ul class="list-group list-group-flush flex-wrap flex-row flex-lg-column">
<li class="list-group-item flex-grow-1">
<a t-if="sale_order.has_to_be_signed(True)" role="button" class="btn btn-primary btn-block mb8" data-toggle="modal" data-target="#modalaccept" href="#">
<i class="fa fa-check"/><t t-if="sale_order.has_to_be_paid(True)"> Sign & Pay</t><t t-else=""> Accept & Sign</t>
</a>
<a t-elif="sale_order.has_to_be_paid(True)" role="button" id="o_sale_portal_paynow" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'btn-block mb8 %s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')" >
<i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept & Pay</t><t t-else="">Pay Now</t>
</a>
<div class="o_download_pdf btn-toolbar flex-sm-nowrap">
<div class="btn-group flex-grow-1 mr-1 mb-1">
<a class="btn btn-secondary btn-block o_download_btn" t-att-href="sale_order.get_portal_url(report_type='pdf', download=True)" title="Download"><i class="fa fa-download"/> Download</a>
</div>
<div class="btn-group flex-grow-1 mb-1">
<a class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print" t-att-href="sale_order.get_portal_url(report_type='pdf')" id="print_invoice_report" title="Print" target="_blank"><i class="fa fa-print"/> Print</a>
</div>
</div>
</li>
<li class="navspy list-group-item pl-0 flex-grow-1" t-ignore="true" role="complementary">
<ul class="nav flex-column bs-sidenav"></ul>
</li>
<t t-if="not sale_order.is_expired and sale_order.state in ['draft', 'sent']">
<li t-if="sale_order.validity_date" class="list-group-item">
<small><b class="text-muted">This offer expires on</b></small>
<div t-field="sale_order.validity_date"></div>
</li>
<li t-if="sale_order.amount_undiscounted - sale_order.amount_untaxed > 0.01" class="list-group-item flex-grow-1">
<small><b class="text-muted">Your advantage</b></small>
<small>
<b t-field="sale_order.amount_undiscounted"
t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'
style="text-decoration: line-through"
class="d-block mt-1"
data-id="amount_undiscounted" />
</small>
<t t-if="sale_order.amount_untaxed == sale_order.amount_total">
<h4 t-field="sale_order.amount_total" class="text-success" data-id="total_amount"/>
</t>
<t t-else="">
<h4 t-field="sale_order.amount_untaxed" class="text-success mb-0" data-id="total_untaxed"/>
<small>(<span t-field="sale_order.amount_total" data-id="total_amount"/> Incl. tax)</small>
</t>
</li>
</t>
<li t-if="sale_order.user_id" class="list-group-item flex-grow-1">
<div class="small mb-1"><strong class="text-muted">Salesperson</strong></div>
<div class="row flex-nowrap">
<div class="col flex-grow-0 pr-2">
<img class="rounded-circle mr4 float-left o_portal_contact_img" t-if="sale_order.user_id.image_1024" t-att-src="image_data_uri(sale_order.user_id.image_1024)" alt="Contact"/>
<img class="rounded-circle mr4 float-left o_portal_contact_img" t-if="not sale_order.user_id.image_1024" src="/web/static/src/img/placeholder.png" alt="Contact"/>
</div>
<div class="col pl-0" style="min-width: 150px">
<span t-field="sale_order.user_id" t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True}'/>
<a href="#discussion" class="small"><i class="fa fa-comment"></i> Send message</a>
</div>
</div>
</li>
</ul>
</t>
</t>
<!-- Page content -->
<div id="quote_content" class="col-12 col-lg justify-content-end">
<!-- modal relative to the actions sign and pay -->
<div role="dialog" class="modal fade" id="modalaccept">
<div class="modal-dialog" t-if="sale_order.has_to_be_signed(True)">
<form id="accept" method="POST" t-att-data-order-id="sale_order.id" t-att-data-token="sale_order.access_token" class="js_accept_json modal-content js_website_submit_form">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<header class="modal-header">
<h4 class="modal-title">Validate Order</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</header>
<main class="modal-body" id="sign-dialog">
<p>
<span>By signing this proposal, I agree to the following terms:</span>
<ul>
<li><span>Accepted on the behalf of:</span> <b t-field="sale_order.partner_id.commercial_partner_id"/></li>
<li><span>For an amount of:</span> <b data-id="total_amount" t-field="sale_order.amount_total"/></li>
<li t-if="sale_order.payment_term_id"><span>With payment terms:</span> <b t-field="sale_order.payment_term_id.note"/></li>
</ul>
</p>
<t t-call="portal.signature_form">
<t t-set="call_url" t-value="sale_order.get_portal_url(suffix='/accept')"/>
<t t-set="default_name" t-value="sale_order.partner_id.name"/>
</t>
</main>
</form>
</div>
<div class="modal-dialog" t-if="not sale_order.has_to_be_signed(True) and sale_order.has_to_be_paid(True)">
<div class="modal-content">
<header class="modal-header">
<h4 class="modal-title">Validate Order</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</header>
<main class="modal-body" id="sign-dialog">
<p>
<span>By paying this proposal, I agree to the following terms:</span>
<ul>
<li><span>Accepted on the behalf of:</span> <b t-field="sale_order.partner_id.commercial_partner_id"/></li>
<li><span>For an amount of:</span> <b data-id="total_amount" t-field="sale_order.amount_total"/></li>
<li t-if="sale_order.payment_term_id"><span>With payment terms:</span> <b t-field="sale_order.payment_term_id.note"/></li>
</ul>
</p>
<div t-if="pms or acquirers" id="payment_method" class="text-left">
<h3 class="mb24">Pay with</h3>
<t t-call="payment.payment_tokens_list">
<t t-set="mode" t-value="'payment'"/>
<t t-set="submit_txt">Pay & Confirm</t>
<t t-set="icon_class" t-value="'fa-lock'"/>
<t t-set="form_action" t-value="sale_order.get_portal_url(suffix='/transaction/token')"/>
<t t-set="prepare_tx_url" t-value="sale_order.get_portal_url(suffix='/transaction/')"/>
<t t-set="access_token" t-value="sale_order.access_token"/>
</t>
</div>
</main>
</div>
</div>
</div>
<!-- modal relative to the action reject -->
<div role="dialog" class="modal fade" id="modaldecline">
<div class="modal-dialog">
<form id="decline" method="POST" t-attf-action="/my/orders/#{sale_order.id}/decline?access_token=#{sale_order.access_token}" class="modal-content">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<header class="modal-header">
<h4 class="modal-title">Reject This Quotation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</header>
<main class="modal-body">
<p>
Tell us why you are refusing this quotation, this will help us improve our services.
</p>
<textarea rows="4" name="decline_message" required="" placeholder="Your feedback..." class="form-control" />
</main>
<footer class="modal-footer">
<button type="submit" t-att-id="sale_order.id" class="btn btn-danger"><i class="fa fa-times"></i> Reject</button>
<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
</footer>
</form>
</div>
</div>
<!-- status messages -->
<div t-if="message == 'sign_ok'" class="alert alert-success alert-dismissable d-print-none" role="status">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
<strong>Thank You!</strong><br/>
<t t-if="message == 'sign_ok' and sale_order.state in ['sale', 'done']">Your order has been confirmed.</t>
<t t-elif="message == 'sign_ok' and sale_order.has_to_be_paid()">Your order has been signed but still needs to be paid to be confirmed.</t>
<t t-else="">Your order has been signed.</t>
</div>
<div t-if="message == 'cant_reject' and sale_order.has_to_be_signed()" class="alert alert-danger alert-dismissable d-print-none" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
Your order is not in a state to be rejected.
</div>
<t t-if="sale_order.transaction_ids">
<t t-call="payment.payment_confirmation_status">
<t t-set="payment_tx_id" t-value="sale_order.get_portal_last_transaction()"/>
<t t-set="reference" t-value="sale_order.reference"/>
</t>
</t>
<div t-if="sale_order.state == 'cancel'" class="alert alert-danger alert-dismissable d-print-none" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="close">×</button>
<strong>This quotation has been canceled.</strong> <a role="button" href="#discussion"><i class="fa fa-comment"/> Contact us to get a new quotation.</a>
</div>
<div t-if="sale_order.is_expired" class="alert alert-warning alert-dismissable d-print-none" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="close">×</button>
<strong>This offer expired!</strong> <a role="button" href="#discussion"><i class="fa fa-comment"/> Contact us to get a new quotation.</a>
</div>
<!-- main content -->
<div t-attf-class="card #{'pb-5' if report_type == 'html' else ''}" id="portal_sale_content">
<div t-call="sale.sale_order_portal_content"/>
</div>
<!-- bottom actions -->
<div t-if="sale_order.has_to_be_signed(True) or sale_order.has_to_be_paid(True)" class="row justify-content-center text-center d-print-none pt-1 pb-4">
<t t-if="sale_order.has_to_be_signed(True)">
<div class="col-sm-auto mt8">
<a role="button" class="btn btn-primary" data-toggle="modal" data-target="#modalaccept" href="#"><i class="fa fa-check"/><t t-if="sale_order.has_to_be_paid(True)"> Sign & Pay</t><t t-else=""> Accept & Sign</t></a>
</div>
<div class="col-sm-auto mt8">
<a role="button" class="btn btn-secondary" href="#discussion"><i class="fa fa-comment"/> Feedback</a>
</div>
<div class="col-sm-auto mt8">
<a role="button" class="btn btn-danger" data-toggle="modal" data-target="#modaldecline" href="#"> <i class="fa fa-times"/> Reject</a>
</div>
</t>
<div t-elif="sale_order.has_to_be_paid(True)" class="col-sm-auto mt8">
<a role="button" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'%s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')">
<i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept & Pay</t><t t-else="">Pay Now</t>
</a>
</div>
</div>
<!-- chatter -->
<div id="sale_order_communication" class="mt-4">
<h2>History</h2>
<t t-call="portal.message_thread">
<t t-set="object" t-value="sale_order"/>
</t>
</div>
</div><!-- // #quote_content -->
</div>
</xpath>
</template>
<!--
Sales Order content : intro, informations, order lines, remarks, descriptions ....
This template should contains all the printable element of the SO. This is the
template rendered in PDF with the report engine.
-->
<template id="sale_order_portal_content" name="Sales Order Portal Content">
<!-- Intro -->
<div id="introduction" t-attf-class="pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}">
<h2 class="my-0">
<t t-esc="sale_order.type_name"/>
<em t-esc="sale_order.name"/>
</h2>
</div>
<div t-attf-class="#{'card-body' if report_type == 'html' else ''}">
<!-- Informations -->
<div id="informations">
<div t-if="sale_order.transaction_ids and not invoices and sale_order.state in ('sent', 'sale') and portal_confirmation == 'pay' and not success and not error" t-att-data-order-id="sale_order.id">
<t t-if="sale_order.transaction_ids">
<t t-call="payment.payment_confirmation_status">
<t t-set="payment_tx_id" t-value="sale_order.get_portal_last_transaction()"/>
<t t-set="reference" t-value="sale_order.reference"/>
</t>
</t>
</div>
<div class="row" id="so_date">
<div class="mb-3 col-6">
<t t-if="sale_order.state in ['sale', 'done', 'cancel']">
<strong>Order Date:</strong>
</t>
<t t-else="">
<strong>Quotation Date:</strong>
</t>
<span t-field="sale_order.date_order" t-options='{"widget": "date"}'/>
</div>
<div class="mb-3 col-6" t-if="sale_order.validity_date">
<strong>Expiration Date:</strong> <span t-field="sale_order.validity_date" t-options='{"widget": "date"}'/>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<strong t-if="sale_order.partner_shipping_id == sale_order.partner_invoice_id" class="d-block mb-1">Invoicing and Shipping Address:</strong>
<strong t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id" class="d-block mb-1">Invoicing Address:</strong>
<address t-field="sale_order.partner_invoice_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</div>
<t t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id">
<div id="shipping_address" class="col-lg-6">
<strong class="d-block mb-1">Shipping Address:</strong>
<address t-field="sale_order.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</div>
</t>
</div>
<t t-set="invoices" t-value="[i for i in sale_order.invoice_ids if i.state not in ['draft', 'cancel']]"/>
<div t-if="invoices" class="row">
<div class="col">
<strong class="d-block mb-1">Invoices</strong>
<ul class="list-group mb-4">
<t t-foreach="invoices" t-as="i">
<t t-set="report_url" t-value="i.get_portal_url(report_type='pdf', download=True)"/>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div>
<a t-att-href="report_url">
<span t-esc="i.name"/>
</a>
<div class="small d-lg-inline-block">Date: <span class="text-muted" t-field="i.invoice_date"/></div>
</div>
<span t-if="i.payment_state in ('paid', 'in_payment')" class="small badge badge-success orders_label_text_align"><i class="fa fa-fw fa-check"/> <b>Paid</b></span>
<span t-else="" class="small badge badge-info orders_label_text_align"><i class="fa fa-fw fa-clock-o"/> <b>Waiting Payment</b></span>
</div>
</t>
</ul>
</div>
</div>
</div>
<section id="details" style="page-break-inside: auto;" class="mt32">
<h3 id="details">Pricing</h3>
<t t-set="display_discount" t-value="True in [line.discount > 0 for line in sale_order.order_line]"/>
<table t-att-data-order-id="sale_order.id" t-att-data-token="sale_order.access_token" class="table table-sm" id="sales_order_table">
<thead class="bg-100">
<tr>
<th class="text-left">Products</th>
<th class="text-right">Quantity</th>
<th t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">Unit Price</th>
<th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<span>Disc.%</span>
</th>
<th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Taxes</span>
</th>
<th class="text-right" >
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-foreach="sale_order.order_line" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type">
<td id="product_name"><span t-field="line.name"/></td>
<td class="text-right">
<div id="quote_qty">
<span t-field="line.product_uom_qty"/>
<span t-field="line.product_uom"/>
</div>
</td>
<td t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<div
t-if="line.discount >= 0"
t-field="line.price_unit"
t-att-style="line.discount and 'text-decoration: line-through' or None"
t-att-class="(line.discount and 'text-danger' or '') + ' text-right'"
/>
<div t-if="line.discount">
<t t-esc="(1-line.discount / 100.0) * line.price_unit" t-options='{"widget": "float", "decimal_precision": "Product Price"}'/>
</div>
</td>
<td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<strong t-if="line.discount > 0" class="text-info">
<t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>%
</strong>
</td>
<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/>
</td>
<td class="text-right">
<span class="oe_order_line_price_subtotal" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<span class="oe_order_line_price_total" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
</td>
</t>
<t t-if="line.display_type == 'line_section'">
<td colspan="99">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'">
<td colspan="99">
<span t-field="line.name"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or sale_order.order_line[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-right">
<td colspan="99">
<strong class="mr16">Subtotal</strong>
<span
t-esc="current_subtotal"
t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'
/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
<div id="total" class="row" name="total" style="page-break-inside: avoid;">
<div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto">
<t t-call="sale.sale_order_portal_content_totals_table"/>
</div>
</div>
</section>
<section t-if="sale_order.signature" id="signature" name="Signature">
<div class="row mt-4" name="signature">
<div t-attf-class="#{'col-3' if report_type != 'html' else 'col-sm-7 col-md-4'} ml-auto text-center">
<h5>Signature</h5>
<img t-att-src="image_data_uri(sale_order.signature)" style="max-height: 6rem; max-width: 100%;"/>
<p t-field="sale_order.signed_by"/>
</div>
</div>
</section>
<section id="terms" class="mt-5" t-if="sale_order.note">
<h3 class="">Terms & Conditions</h3>
<hr class="mt-0 mb-1"/>
<em t-field="sale_order.note"/>
</section>
<section class="mt-5" t-if="sale_order.payment_term_id">
<h3 class="">Payment terms</h3>
<hr class="mt-0 mb-1"/>
<span t-field="sale_order.payment_term_id"/>
</section>
</div>
</template>
<template id="sale_order_portal_content_totals_table">
<table class="table table-sm">
<tr class="border-black">
<td><strong>Subtotal</strong></td>
<td class="text-right">
<span
data-id="total_untaxed"
t-field="sale_order.amount_untaxed"
t-options='{"widget": "monetary","display_currency": sale_order.pricelist_id.currency_id}'
/>
</td>
</tr>
<t t-foreach="sale_order.amount_by_group" t-as="amount_by_group">
<tr>
<t t-if="amount_by_group[3] == 1 and sale_order.amount_untaxed == amount_by_group[2]">
<td>
<span t-esc="amount_by_group[0]"/>
<span>&nbsp;<span>on</span>&nbsp;<t t-esc="amount_by_group[2]" t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/></span>
</td>
<td class="text-right">
<span t-esc="amount_by_group[1]"
t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/>
</td>
</t>
<t t-else ="">
<td>
<span t-esc="amount_by_group[0]"/>
</td>
<td class="text-right">
<span t-esc="amount_by_group[1]"
t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/>
</td>
</t>
</tr>
</t>
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right">
<span data-id="total_amount" t-field="sale_order.amount_total" t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/>
</td>
</tr>
</table>
</template>
</odoo>
|