odoo/ext/custom-addons/dp_reports_stock/reports/stock.xml

370 lines
20 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Sale Order Body -->
<template id="report_stockpicking_document">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})"/>
<div class="page">
<div class="row">
<div class="col-xs-3">
<div>
<strong>Delivery Address:</strong>
</div>
<!--
<div t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
-->
<div class="partner-data">
<span t-esc="o.partner_id.name"/>
<br/>
<t t-if="o.partner_id.name2">
<span t-esc="o.partner_id.name2"/>
<br/>
</t>
<span t-esc="o.partner_id.street"/>
<br/>
<span t-esc="o.partner_id.zip"/>
<span t-esc="o.partner_id.city"/>
<br/>
<span t-esc="o.partner_id.country_id.name"/>
<br/>
<t t-if="o.partner_id.phone">
<div>
<strong>Tel: </strong>
<span t-esc="o.partner_id.phone"/>
</div>
</t>
<t t-if="o.partner_id.mobile">
<div>
<strong>Mobile: </strong>
<span t-esc="o.partner_id.mobile"/>
</div>
</t>
</div>
</div>
<div class="col-xs-3">
<strong>Customer Address:</strong>
<!--
<div t-field="o.sale_id.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
-->
<div class="partner-data">
<span t-esc="o.sale_id.partner_id.name"/>
<br/>
<t t-if="o.sale_id.partner_id.name2">
<span t-esc="o.sale_id.partner_id.name2"/>
<br/>
</t>
<span t-esc="o.sale_id.partner_id.street"/>
<br/>
<span t-esc="o.sale_id.partner_id.zip"/>
<span t-esc="o.sale_id.partner_id.city"/>
<br/>
<span t-esc="o.sale_id.partner_id.country_id.name"/>
<br/>
<t t-if="o.sale_id.partner_id.phone">
<div>
<strong>Tel: </strong>
<span t-esc="o.sale_id.partner_id.phone"/>
</div>
</t>
<t t-if="o.sale_id.partner_id.mobile">
<div>
<strong>Mobil: </strong>
<span t-esc="o.sale_id.partner_id.mobile"/>
</div>
</t>
</div>
</div>
<div class="col-xs-3">
</div>
<div class="col-xs-3">
<t t-call="dp_reports.company_data"/>
</div>
</div>
<div class="row">
<div class="col-xs-6" name="customer_address">
<!-- <div>
<strong>Customer Address:</strong>
</div>
<div t-if="o.move_lines and o.move_lines[0].partner_id" name="partner_header">
<div t-field="o.move_lines[0].partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
</div>
<div t-if="not (o.move_lines and o.move_lines[0].partner_id) and o.partner_id"
name="partner_header">
<div t-field="o.partner_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True}'/>
</div>
-->
<br/>
<div>
<strong>Customer Reference:</strong>
<p t-field="o.sale_id.client_order_ref"/>
</div>
<div>
<strong>Source Document:</strong>
<p t-field="o.origin"/>
</div>
</div>
</div>
<table class="table table-condensed mt32">
<thead class="table-header">
<tr>
<th t-if="o.origin">
<strong>Order (Origin)</strong>
</th>
<th t-if="o.shopping_cart_ref">
<strong>Shopping-Basket:</strong>
</th>
<th name="td_sched_date_h">
<strong>Date</strong>
</th>
<th t-if="o.picking_type_id.code == 'outgoing' and o.carrier_id">
<strong>Carrier</strong>
</th>
<!--<th t-if="o.weight">-->
<!--<strong>Weight</strong>-->
<!--</th>-->
<th t-if="o.carrier_tracking_ref">
<strong>Tracking Number</strong>
</th>
</tr>
</thead>
<tbody class="stock-tbody">
<tr>
<td t-if="o.origin">
<span t-field="o.origin"/>
</td>
<td t-if="o.shopping_cart_ref">
<span t-field="o.shopping_cart_ref"/>
</td>
<!--
<td name="td_sched_date">
<t t-if="o.state == 'done'">
<span t-field="o.date_done"/>
</t>
<t t-if="o.state != 'done'">
<span t-field="o.scheduled_date"/>
</t>
</td>
-->
<td name="td_sched_date">
<span t-field="o.scheduled_date" t-field-options='{"widget": "date"}'/>
</td>
<td t-if="o.picking_type_id.code == 'outgoing' and o.carrier_id">
<span t-field="o.carrier_id"/>
</td>
<!--<td t-if="o.weight">-->
<!--<span t-field="o.weight"/>-->
<!--<span t-field="o.weight_uom_id"/>-->
<!--</td>-->
<td t-if="o.carrier_tracking_ref">
<span t-field="o.carrier_tracking_ref"/>
</td>
</tr>
</tbody>
</table>
<t t-set="total_ordered_qty" t-value="0"/>
<t t-set="total_dlv_qty" t-value="0"/>
<table class="table table-condensed mt48" t-if="not o.move_line_ids">
<thead class="table-header">
<tr>
<th>
<strong>Product</strong>
</th>
<th>
<strong>Ordered Quantity</strong>
</th>
</tr>
</thead>
<tbody class="stock-tbody">
<tr t-foreach="o.move_lines" t-as="move">
<td>
<span t-field="move.product_id"/>
</td>
<td>
<t t-set="ordered_qty" t-value="int(o._formatLang(move_line.ordered_qty).strip('0').strip(',').strip('.'))"/>
<t t-set="total_ordered_qty" t-value="total_ordered_qty+ordered_qty"/>
<t t-set="dlv_qty" t-value="int(move_line.qty_done)"/>
<t t-set="total_dlv_qty" t-value="total_dlv_qty+dlv_qty"/>
<span t-esc="ordered_qty"/>
<span t-field="move.product_uom"/>
</td>
</tr>
</tbody>
</table>
<t t-set="backorder" t-value="False"/>
<table class="table table-condensed mt48" t-if="o.move_line_ids">
<t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')"
groups="stock.group_production_lot"/>
<thead class="table-header">
<tr>
<th>
<strong>Product</strong>
</th>
<!-- <th name="lot_serial" t-if="has_serial_number"> -->
<th class="text-center" name="lot_serial" t-if="has_serial_number and any([move_line.product_id.can_be_sold_unconfigured for move_line in o.move_line_ids])">
Lot/Serial Number
</th>
<th class="text-center">
<strong>Weight</strong>
</th>
<th class="text-right">
<strong>Ordered Quantity</strong>
</th>
<th t-if="any([move_line.state == 'done' for move_line in o.move_line_ids])"
class="text-right">
<strong>Delivered Quantity</strong>
</th>
</tr>
</thead>
<tbody class="stock-tbody">
<tr t-foreach="o.move_line_ids" t-as="move_line">
<td>
<p t-if="not move_line.product_id.can_be_sold_unconfigured">
<span t-field="move_line.product_id"/><br />
<span t-field="move_line.move_id.name" style="max-height: 100px;"/>
</p>
<p t-if="move_line.product_id.can_be_sold_unconfigured">
<span t-field="move_line.move_id.name"/>
<t t-if="move_line.product_id.default_code and move_line.product_id.material_type_id.print_default_code">
<strong>
<span t-field="move_line.product_id.default_code"/>
</strong>
<br/>
</t>
</p>
<p t-if="o.picking_type_code == 'outgoing'">
<span t-field="move_line.product_id.sudo().description_pickingout"/>
</p>
<p t-if="o.picking_type_code == 'incoming'">
<span t-field="move_line.product_id.sudo().description_pickingin"/>
</p>
<t t-if="not move_line.product_id and move_line.package_id">
<span t-field="move_line.package_id"/>
</t>
</td>
<t t-if="has_serial_number and any([move_line.product_id.can_be_sold_unconfigured for move_line in o.move_line_ids])">
<td class="text-center">
<table width="100%">
<tr>
<td>
<span t-field="move_line.lot_id" t-if="move_line.product_id.can_be_sold_unconfigured"/>
</td>
<td name="lot_qty">
<t t-if="move_line.product_qty and move_line.product_id.can_be_sold_unconfigured">
<span t-esc="o._formatLang(move_line.product_qty).strip('0').strip(',').strip('.')"/>
</t>
</td>
</tr>
</table>
</td>
</t>
<td class="text-center">
<t t-if="not move_line.lot_id or move_line.product_id.can_be_sold_unconfigured">
<span t-esc="move_line.ordered_qty*move_line.product_id.weight"/>
<!-- <span t-field="move_line.product_id.weight"/> -->
</t>
<t t-if="move_line.lot_id and not move_line.product_id.can_be_sold_unconfigured">
<!-- <t t-set="weight" t-value="move_line.ordered_qty*move_line.lot_id.weight"/> -->
<span t-esc="round(move_line.lot_id.weight,2)"/>
</t>
</td>
<td class="text-right">
<span t-field="move_line.package_id"/>
<span t-if="move_line.package_id">:</span>
<!--
<t t-set="ordered_qty" t-value="int(o._formatLang(move_line.ordered_qty).strip('0').strip(',').strip('.'))"/>
<t t-set="total_ordered_qty" t-value="total_ordered_qty+ordered_qty"/>
-->
<t t-set="ordered_qty" t-value="int(move_line.ordered_qty)"/>
<t t-set="total_ordered_qty" t-value="total_ordered_qty+ordered_qty"/>
<t t-set="dlv_qty" t-value="int(move_line.qty_done)"/>
<t t-set="total_dlv_qty" t-value="total_dlv_qty+dlv_qty"/>
<span t-esc="ordered_qty"/>
<span t-field="move_line.product_uom_id"/>
</td>
<td class="text-right" t-if="move_line.state == 'done'">
<t t-if="move_line.ordered_qty != move_line.qty_done">
<t t-set="backorder" t-value="True"/>
</t>
<span t-esc="o._formatLang(move_line.qty_done).strip('0').strip(',').strip('.')"/>
<span t-field="move_line.product_uom_id"/>
</td>
<td class="text-right" t-if="move_line.lot_id.notes">
<t t-if="move_line.lot_id and move_line.lot_id.notes">
<span t-esc="move_line.lot_id.notes"/>
</t>
</td>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-xs-6">
<span style="padding-top: 5px; border-top: 1px solid;">
<strong>Total Weight:</strong>
<span t-esc="round(o.weight,2)"/>
</span>
</div>
<div class="col-xs-6">
<span class="pull-right" style="padding-top: 5px; border-top: 1px solid;">
<strong>Total Amount:</strong>
<!--
<span t-esc="total_ordered_qty" t-if="total_dlv_qty==0"/>
<span t-esc="total_dlv_qty" t-if="total_dlv_qty>0"/>
-->
<span t-esc="total_ordered_qty" t-if="not backorder"/>
<span t-esc="total_dlv_qty" t-if="backorder"/>
</span>
</div>
</div>
<div class="col-xs-12 dp_note">
<span t-field="o.note"/>
</div>
<p t-if="o.backorder_id">
This shipment is a backorder of<t t-esc="o.backorder_id.name"/>.
</p>
<p>
<t t-if="backorder">
All items couldn't be shipped, the remaining ones will be shipped as soon as they become
available.
</t>
</p>
<div class="col-xs-5 text-right">
<p t-if="o.picking_signature">
Signature
</p>
<img t-if="o.picking_signature" t-att-src="'data:image/png;base64,%s' % o.picking_signature.decode()"
style="max-height: 85px;"/>
</div>
</div>
</t>
</template>
<template id="stock.report_deliveryslip">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="is_picking" t-value="True"/>
<t t-call="dp_reports_stock.report_stockpicking_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>
</data>
<record id="stock.action_report_delivery" model="ir.actions.report">
<field name="paperformat_id" ref="dp_reports.paperformat_a4_european"/>
</record>
</odoo>