242 lines
15 KiB
XML
242 lines
15 KiB
XML
<t t-name="stock.label_transfer_template_view.basis57">
|
|
<t t-call="web.basic_layout">
|
|
<style>
|
|
.external-ref {
|
|
font-size: 14mm;
|
|
}
|
|
.box.external-ref {
|
|
font-size: 20mm;
|
|
}
|
|
.title {
|
|
font-size: 12mm;
|
|
}
|
|
.address {
|
|
font-size: 10mm;
|
|
}
|
|
.box.address {
|
|
font-size: 14mm;
|
|
font-weight: bolder;
|
|
}
|
|
.barcode {
|
|
font-size: 6mm;
|
|
}
|
|
.default {
|
|
font-size: 7mm;
|
|
}
|
|
.bolder {
|
|
font-size: 7mm;
|
|
font-weight: bolder;
|
|
}
|
|
.footer {
|
|
font-size: 7mm;
|
|
}
|
|
div.label {
|
|
line-height: 1.2;
|
|
text-align: center;
|
|
}
|
|
br {
|
|
font-size: 2mm;
|
|
}
|
|
.space-right {
|
|
margin-right: 2mm
|
|
}
|
|
.space-left {
|
|
margin-left: 2mm
|
|
}
|
|
.address-space-right {
|
|
padding-right: 3mm
|
|
}
|
|
svg {
|
|
position: absolute;
|
|
left: 10px;
|
|
margin-top: 10px
|
|
}
|
|
</style>
|
|
<t t-foreach="docs" t-as="picking">
|
|
<t t-foreach="picking.move_lines.filtered(lambda m: m.quantity_done > 0 and m.product_packaging)" t-as="move">
|
|
<!--Set default values-->
|
|
<t t-set="temperature" t-value="2"/>
|
|
<t t-set="today" t-value="context_timestamp(datetime.datetime.now())"/>
|
|
<t t-set="packaging" t-value="move.product_packaging"/>
|
|
<t t-set="external_ref" t-value="picking.partner_id.x_external_ref"/>
|
|
<t t-set="print_header" t-value="True"/>
|
|
<t t-set="print_delivery_date" t-value="False"/>
|
|
<t t-set="print_delivery_date_only" t-value="False"/>
|
|
<t t-set="barcode" t-value="packaging.barcode"/>
|
|
<t t-set="qty_description" t-value="packaging.x_qty_description"/>
|
|
<!--Print delivery date if shipping method is Bordereau-->
|
|
<t t-if="picking.carrier_id.name == 'Bordereau'">
|
|
<t t-set="print_delivery_date" t-value="True"/>
|
|
</t>
|
|
<!--Calculate default expiration date-->
|
|
<t t-set="delta" t-value="datetime.timedelta(days=move.product_id.x_expiration_days)"/>
|
|
<t t-set="consume_until" t-value="today + delta"/>
|
|
<!--Print report for each move line-->
|
|
<t t-set="move_lines" t-value="move.move_line_ids.filtered(lambda l: l.qty_done > 0)"/>
|
|
<t t-foreach="move_lines" t-as="move_line">
|
|
<!--Set default values-->
|
|
<t t-set="count_boxes" t-value="0"/>
|
|
<t t-set="count_labels" t-value="0"/>
|
|
<t t-set="count_labels" t-value="move_line.qty_done/(packaging.qty or 1.0)"/>
|
|
<t t-if="packaging.name == 'Kiste'">
|
|
<t t-set="print_weight" t-value="True"/>
|
|
</t>
|
|
<!--Compute box count-->
|
|
<t t-if="count_boxes == 0">
|
|
<!--<span>qty_done:</span><span t-esc="move_line.qty_done" />-->
|
|
<!--<span>quantity_done:</span><span t-esc="move.quantity_done" />-->
|
|
<!--<span>x_count_boxes:</span><span t-esc="move.x_count_boxes" />-->
|
|
<t t-set="count_boxes" t-value="int(((move_line.qty_done + 0.1) / move.quantity_done) * move.x_count_boxes)"/>
|
|
</t>
|
|
<t t-if="packaging.x_print_without_parent" t-set="count_boxes" t-value="0"/>
|
|
<t t-set="count_pages" t-value="int(count_labels + count_boxes)"/>
|
|
<t t-if="packaging.x_print_parent_only" t-set="count_pages" t-value="int(count_boxes)"/>
|
|
<!--<span>count_boxes:</span><span t-esc="count_boxes" />-->
|
|
<!--<span>count_labels:</span><span t-esc="count_labels" />-->
|
|
<!--<span>count_pages:</span><span t-esc="count_pages" />-->
|
|
<!--Print report for each label and box count-->
|
|
<t t-foreach="range(0, count_pages)" t-as="page">
|
|
<!--Caclulate expiration date from settings-->
|
|
<t t-if="move.product_id.use_expiration_date">
|
|
<t t-set="delta" t-value="datetime.timedelta(days=move.product_id.expiration_time)"/>
|
|
<t t-set="consume_until" t-value="context_timestamp(move_line.lot_id.removal_date)"/>
|
|
<t t-set="today" t-value="consume_until - delta"/>
|
|
</t>
|
|
<!--First print normal labels and then box labels-->
|
|
<t t-if="page_index >= (count_pages - count_boxes)">
|
|
<t t-set="qty_description"/>
|
|
<t t-if="external_ref">
|
|
<t t-set="print_header" t-value="False"/>
|
|
<t t-set="print_delivery_date_only" t-value="True"/>
|
|
</t>
|
|
<t t-if="packaging.parent_packaging">
|
|
<t t-if="packaging.parent_packaging.barcode" t-set="barcode" t-value="packaging.parent_packaging.barcode"/>
|
|
<t t-set="qty_description" t-value="packaging.parent_packaging.x_qty_description"/>
|
|
</t>
|
|
</t>
|
|
<div class="page">
|
|
<div class="label">
|
|
<t t-if="picking.partner_id.hide_address or not print_header">
|
|
<br/>
|
|
<br/>
|
|
</t>
|
|
<br/>
|
|
<br/>
|
|
<t t-if="print_header">
|
|
<t t-if="picking.partner_id.x_packaging_ref">
|
|
<span class="text-uppercase use-font-opensans-medium title space-right" t-esc="picking.partner_id.x_packaging_ref"/>
|
|
</t>
|
|
<span class="text-uppercase use-font-opensans-medium title">Gotthard-Zander</span>
|
|
<br/>
|
|
<span class="text-uppercase use-font-opensans-bold title" t-esc="move.product_id.name"/>
|
|
<t t-if="move.product_id.x_calibre">
|
|
<span class="use-font-opensans-medium default space-left" t-esc="move.product_id.x_calibre"/>
|
|
</t>
|
|
<br/>
|
|
<span class="use-font-opensans-medium default">(Sander lucioperca) in Aquakultur gewonnen</span>
|
|
<br/>
|
|
<t t-if="qty_description or print_weight">
|
|
<span class="use-font-opensans-medium default">Gewicht: </span>
|
|
<span class="use-font-opensans-medium default" t-if="not print_weight" t-esc="qty_description"/>
|
|
<span class="use-font-opensans-medium default" t-if="print_weight" t-esc="move.quantity_done *1000" t-options="{"widget": "float", "precision": 0}"/>
|
|
<span class="use-font-opensans-medium default" t-if="print_weight">
|
|
g zu
|
|
<span t-esc="move.x_count_boxes"/>
|
|
Kisten
|
|
</span>
|
|
</t>
|
|
</t>
|
|
<br/>
|
|
<t t-if="print_delivery_date and not print_delivery_date_only">
|
|
<span class="use-font-opensans-medium bolder">Lieferdatum: </span>
|
|
<span class="use-font-opensans-medium bolder" t-esc="picking.scheduled_date.strftime('%d.%m.%Y')"/>
|
|
<br/>
|
|
</t>
|
|
<br/>
|
|
<t t-if="not picking.partner_id.hide_address">
|
|
<div id="address">
|
|
<t t-if="external_ref and print_header">
|
|
<span class="use-font-opensans-bold external-ref" t-esc="external_ref"/>
|
|
<br/>
|
|
<span class="use-font-opensans-bold address" t-field="picking.partner_id.name"/>
|
|
<br/>
|
|
<span class="use-font-opensans-bold address address-space-right" t-field="picking.partner_id.zip"/>
|
|
<span class="use-font-opensans-bold address" t-field="picking.partner_id.city"/>
|
|
<br/>
|
|
<br/>
|
|
</t>
|
|
<t t-if="external_ref and not print_header">
|
|
<span class="use-font-opensans-bold box external-ref" t-esc="external_ref"/>
|
|
<br/>
|
|
<span class="use-font-opensans-bold box address" t-field="picking.partner_id.name"/>
|
|
<br/>
|
|
<!--<span class="use-font-opensans-bold box address address-space-right" t-field="picking.partner_id.zip" />-->
|
|
<!--<span class="use-font-opensans-bold box address" t-field="picking.partner_id.city" />-->
|
|
<br/>
|
|
<br/>
|
|
</t>
|
|
<t t-if="not external_ref and print_header">
|
|
<span class="use-font-opensans-bold address" t-field="picking.partner_id.name"/>
|
|
<br/>
|
|
<span class="use-font-opensans-bold address address-space-right" t-field="picking.partner_id.zip"/>
|
|
<span class="use-font-opensans-bold address" t-field="picking.partner_id.city"/>
|
|
<br/>
|
|
<br/>
|
|
</t>
|
|
</div>
|
|
</t>
|
|
<t t-if="not print_delivery_date_only">
|
|
<span class="use-font-opensans-medium default">Verpackt am: </span>
|
|
<span class="use-font-opensans-medium default" t-esc="today.strftime('%d.%m.%Y')"/>
|
|
<br/>
|
|
<span class="use-font-opensans-medium default">Mindestens haltbar bis: </span>
|
|
<span class="use-font-opensans-medium default" t-esc="consume_until.strftime('%d.%m.%Y')"/>
|
|
<br/>
|
|
<span class="use-font-opensans-medium default">
|
|
Aufbewahrung: bei
|
|
<span t-esc="move.product_id.x_storage_temperature"/>
|
|
°C
|
|
</span>
|
|
</t>
|
|
<t t-if="print_delivery_date_only">
|
|
<span class="use-font-opensans-medium address">Lieferdatum: </span>
|
|
<span class="use-font-opensans-medium address" t-esc="picking.scheduled_date.strftime('%d.%m.%Y')"/>
|
|
<br/>
|
|
</t>
|
|
<br/>
|
|
<br/>
|
|
<t>
|
|
<img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('EAN13', barcode, 600, 50)" alt="Barcode"/>
|
|
<br/>
|
|
<span class="use-font-opensans-medium barcode" t-esc="'%s %s %s' % (barcode[0], barcode[1:8], barcode[8:])"/>
|
|
</t>
|
|
<br/>
|
|
<br/>
|
|
<span class="text-uppercase use-font-opensans-bold default">Gotthard-Zander</span>
|
|
<span class="use-font-opensans-bold default"> by Basis57</span>
|
|
<br/>
|
|
<br/>
|
|
<span class="use-font-opensans-medium footer" t-field="res_company.street"/>
|
|
<span class="use-font-opensans-medium footer space-right">,</span>
|
|
<span class="use-font-opensans-medium footer space-right" t-field="res_company.zip"/>
|
|
<span class="use-font-opensans-medium footer" t-field="res_company.city"/>
|
|
<br/>
|
|
<span class="use-font-opensans-medium footer">www.gotthard-zander.ch</span>
|
|
<svg viewBox="0 0 150 100" width="150" height="100">
|
|
<ellipse style="stroke: rgb(0, 0, 0); fill: none; stroke-width: 4px;" cx="75" cy="49.556" rx="70" ry="45" data-bx-origin="-1.166667 -2"/>
|
|
<text style="fill: rgb(51, 51, 51); font-family: Arial, sans-serif; font-size: 14px; font-weight: 700; text-anchor: middle; white-space: pre;" data-bx-origin="-1.600941 -3.727571" transform="matrix(1.475051, 0, 0, 1.713593, -78.134323, -123.083534)">
|
|
<tspan x="102.8" y="96.183">CH</tspan>
|
|
<tspan x="102.8" dy="1em">​</tspan>
|
|
<tspan>71758556</tspan>
|
|
</text>
|
|
</svg>
|
|
</div>
|
|
<p style="page-break-before:always;"/>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</t>
|