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
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="stock_picking_batch.report_picking_batch">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="move_line_ids" t-value="o.picking_ids.mapped('move_line_ids')"/>
<t t-set="has_package" t-value="move_line_ids.filtered('result_package_id')" groups="stock.group_tracking_lot"/>
<t t-set="has_serial_number" t-value="move_line_ids.filtered('lot_id')" groups="stock.group_production_lot"/>
<t t-set="has_barcode" t-value="move_line_ids.mapped('product_id').filtered('barcode')"/>
<t t-set="locations" t-value="move_line_ids.mapped('location_id').sorted(lambda location: location.complete_name)"/>
<t t-call="web.external_layout">
<div class="page">
<div class="d-flex">
<div><h3>Summary: <span t-field="o.name"/></h3></div>
<div class="mr-auto">
<img alt="Barcode" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', quote_plus(o.name or ''), 600, 150)" style="width:300px;height:50px"/>
</div>
</div>
<div t-if="o.user_id">
<strong>Responsible:</strong>
<span t-field="o.user_id"/>
</div><br/>
<table class="table table-condensed">
<thead>
<tr>
<th>Transfer</th>
<th>Barcode</th>
<th>Status</th>
<th>Scheduled Date</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.picking_ids" t-as="pick">
<td>
<span t-field="pick.name"/>
</td>
<td>
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&quiet=%s' % ('Code128', pick.name, 400, 100, 0)" style="width:200px;height:50px" alt="Barcode"/>
</td>
<td>
<span t-field="pick.state"/>
</td>
<td >
<span t-field="pick.scheduled_date"/>
</td>
</tr>
</tbody>
</table>
<p style="page-break-after: always;"/>
<t t-foreach="locations" t-as="location">
<t t-set="loc_move_line" t-value="move_line_ids.filtered(lambda x: x.location_id==location)"/>
<t t-set="products" t-value="loc_move_line.mapped('product_id')"/>
<h3><span t-field="o.name"/></h3>
<div t-if="o.user_id">
<strong>Responsible:</strong>
<span t-field="o.user_id"/>
</div><br/>
<h4><strong>To take from: <span t-field="location.display_name"/></strong></h4>
<table class="table table-condensed">
<thead>
<tr>
<th>Product</th>
<th>Quantity</th>
<th width="27%">To</th>
<th width="23%">Transfer</th>
<th t-if="has_serial_number" width="15%">
<strong>Lot/Serial Number</strong>
</th>
<th t-if="has_barcode" width="15%" class="text-center">
<strong>Product Barcode</strong>
</th>
<th t-if="has_package" width="15%">
<strong>Package</strong>
</th>
</tr>
</thead>
<tbody>
<tr t-foreach="loc_move_line" t-as="move_operation">
<td>
<span t-field="move_operation.display_name"/>
</td>
<td>
<t t-if="not has_package">
<t t-if="move_operation.state == 'done'">
<span t-esc="sum(move_operation.mapped('qty_done'))"/>
</t>
<t t-else="">
<span t-esc="sum(move_operation.mapped('product_uom_qty'))"/>
</t>
</t>
<t t-if="has_package">
<span t-esc="sum(move_operation.mapped('qty_done'))"/>
</t>
<span t-field="move_operation.uom_id" groups="move_operation.group_uom"/>
</td>
<td>
<span t-esc="move_operation.mapped('location_dest_id').display_name"/>
</td>
<td>
<span t-esc="move_operation.mapped('picking_id').display_name"/>
</td>
<td t-if="has_serial_number" class="text-center h6" width="15%">
<img t-if="move_operation.lot_id or move_operation.lot_name" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s&humanreadable=1' % ('Code128', move_operation.lot_id.name, 600, 100)" style="width:100%;height:35px;" alt="Barcode"/>
</td>
<td width="15%" class="text-center" t-if="has_barcode">
<span t-if="move_operation.product_id and move_operation.product_id.barcode">
<img t-if="len(move_operation.product_id.barcode) == 13" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', move_operation.product_id.barcode, 600, 100)" style="width:100%;height:35px" alt="Barcode"/>
<img t-elif="len(move_operation.product_id.barcode) == 8" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN8', move_operation.product_id.barcode, 600, 100)" style="width:100%;height:35px" alt="Barcode"/>
<img t-else="" t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128', move_operation.product_id.barcode, 600, 100)" style="width:100%;height:35px" alt="Barcode"/>
</span>
</td>
<td t-if="has_package" width="15%">
<span t-field="move_operation.package_id"/>
<t t-if="move_operation.result_package_id">
→ <span t-field="move_operation.result_package_id"/>
</t>
</td>
</tr>
</tbody>
</table>
<p style="page-break-after: always;"/>
</t>
</div>
</t>
</t>
</t>
</template>
</data>
</odoo>
|