You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
263 lines
15 KiB
263 lines
15 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<!-- Stock report attractive template-->
|
|
<template id="report_stock_attractive_document">
|
|
<t t-if="o and 'company_id' in o">
|
|
<t t-set="company" t-value="o.company_id"/>
|
|
</t>
|
|
<t t-if="not o or not 'company_id' in o">
|
|
<t t-set="company" t-value="res_company"/>
|
|
</t>
|
|
<div class="header row mt32 mb32">
|
|
<div class="page-header col-12">
|
|
<div t-attf-class="pull-left">
|
|
<t t-if="company.logo">
|
|
<img t-if="company.logo" t-att-src="image_data_uri(company.logo)"
|
|
style="max-height: 80px;"/>
|
|
</t>
|
|
</div>
|
|
<div t-attf-class="pull-left"
|
|
t-attf-style="font:14px lucida-console,sans-serif; color:#{o.theme_id.company_text_color} !important;">
|
|
<span t-field="company.partner_id"/>
|
|
<br/>
|
|
<span t-field="company.partner_id.street"/>
|
|
<br/>
|
|
<span t-field="company.partner_id.street2"/>
|
|
<br/>
|
|
<span t-field="company.partner_id.city"/>
|
|
<br/>
|
|
<span t-field="company.partner_id.country_id"/>
|
|
<br/>
|
|
<span t-field="company.partner_id.vat"/>
|
|
<br/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<t t-call="web.html_container">
|
|
<t t-call="web.external_layout">
|
|
<t t-set="o" t-value="o.with_context(lang=o.partner_id.lang)"/>
|
|
<t t-set="partner" t-value="o.partner_id or (o.move_ids and o.move_ids[0].partner_id) or False"/>
|
|
<div class="row col-6"
|
|
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<div name="div_incoming_address">
|
|
<div name="vendor_address" t-if="o.picking_type_id.code=='incoming' and partner">
|
|
<span>
|
|
<strong>Vendor Address:</strong>
|
|
</span>
|
|
</div>
|
|
<div name="warehouse_address" t-if="o.picking_type_id.code=='internal' and partner">
|
|
<span>
|
|
<strong>Warehouse Address:</strong>
|
|
</span>
|
|
</div>
|
|
<div name="customer_address" t-if="o.picking_type_id.code=='outgoing' and partner">
|
|
<span>
|
|
<strong>Customer Address:</strong>
|
|
</span>
|
|
</div>
|
|
<div t-if="partner" name="partner_header">
|
|
<div t-field="partner.commercial_partner_id"
|
|
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "vat"], "no_marker": True, "phone_icons": True}'/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<br/>
|
|
<div class="col-12"
|
|
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<h2>Number
|
|
<span t-field="o.name"/>
|
|
</h2>
|
|
</div>
|
|
<div class="page">
|
|
<div class="row mt32 mb32"
|
|
t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<div t-if="o.origin" class="col-auto" name="div_origin">
|
|
<strong>Order:</strong>
|
|
<p t-field="o.origin"/>
|
|
</div>
|
|
<div t-if="o.state" class="col-auto" name="div_sched_date">
|
|
<strong>Shipping Date:</strong>
|
|
<t t-if="o.state == 'done'">
|
|
<p t-field="o.date_done"/>
|
|
</t>
|
|
<t t-if="o.state != 'done'">
|
|
<p t-field="o.scheduled_date"/>
|
|
</t>
|
|
</div>
|
|
<div t-if="o.scheduled_date" class="col-auto" name="div_sched_date">
|
|
<strong>Scheduled Date:</strong>
|
|
<p t-field="o.scheduled_date"/>
|
|
</div>
|
|
<div t-if="o.origin" class="col-auto" name="div_sched_date">
|
|
<strong>Source:</strong>
|
|
<p t-field="o.origin"/>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<br/>
|
|
<br/>
|
|
<table class="table table-sm" t-if="o.state!='done'" name="stock_move_table">
|
|
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<tr>
|
|
<th name="th_sm_product">
|
|
<strong>Product</strong>
|
|
</th>
|
|
<th name="th_sm_ordered">
|
|
<strong>Ordered</strong>
|
|
</th>
|
|
<th name="th_sm_quantity">
|
|
<strong>Delivered</strong>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<t t-set="lines" t-value="o.move_ids.filtered(lambda x: x.product_uom_qty)"/>
|
|
<tr t-foreach="lines" t-as="move">
|
|
<td>
|
|
<span t-field="move.product_id"/>
|
|
<p t-if="move.description_picking != move.product_id.name and move.description_picking != move.product_id.display_name">
|
|
<span t-field="move.description_picking"/>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<span t-field="move.product_uom_qty"/>
|
|
<span t-field="move.product_uom"/>
|
|
</td>
|
|
<td>
|
|
<span t-field="move.quantity"/>
|
|
<span t-field="move.product_uom"/>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table class="table table-sm mt48" t-if="o.move_line_ids and o.state=='done'"
|
|
name="stock_move_line_table">
|
|
<t t-set="has_serial_number" t-value="False"/>
|
|
<t t-set="has_serial_number" t-value="o.move_line_ids.mapped('lot_id')"
|
|
groups="stock.group_lot_on_delivery_slip"/>
|
|
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<tr>
|
|
<th name="th_sml_product">
|
|
<strong>Product</strong>
|
|
</th>
|
|
<t name="lot_serial" t-if="has_serial_number">
|
|
<th>
|
|
Lot/Serial Number
|
|
</th>
|
|
</t>
|
|
<th name="th_sml_qty_ordered" class="text-center" t-if="not has_serial_number">
|
|
<strong>Ordered</strong>
|
|
</th>
|
|
<th name="th_sml_quantity" class="text-center">
|
|
<strong>Delivered</strong>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<!-- This part gets complicated with different use cases (additional use cases in extensions of this report):
|
|
1. If serial numbers are used and set to print on delivery slip => print lines as is, otherwise group them by overlapping
|
|
product + description + uom combinations
|
|
2. If any packages are assigned => split products up by package (or non-package) and then apply use case 1 -->
|
|
<!-- If has destination packages => create sections of corresponding products -->
|
|
<t t-if="o.has_packages" name="has_packages">
|
|
<t t-set="packages" t-value="o.move_line_ids.mapped('result_package_id')"/>
|
|
<t t-foreach="packages" t-as="package">
|
|
<t t-call="stock.stock_report_delivery_package_section_line"/>
|
|
<t t-set="package_move_lines"
|
|
t-value="o.move_line_ids.filtered(lambda l: l.result_package_id == package)"/>
|
|
<!-- If printing lots/serial numbers => keep products in original lines -->
|
|
<t t-if="has_serial_number">
|
|
<tr t-foreach="package_move_lines" t-as="move_line">
|
|
<t t-call="stock.stock_report_delivery_has_serial_move_line"/>
|
|
</tr>
|
|
</t>
|
|
<!-- If not printing lots/serial numbers => merge lines with same product+description+uom -->
|
|
<t t-else="">
|
|
<t t-set="aggregated_lines"
|
|
t-value="package_move_lines._get_aggregated_product_quantities(strict=True)"/>
|
|
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/>
|
|
</t>
|
|
</t>
|
|
<!-- Make sure we do another section for package-less products if they exist -->
|
|
<t t-set="move_lines"
|
|
t-value="o.move_line_ids.filtered(lambda l: not l.result_package_id)"/>
|
|
<t t-set="aggregated_lines"
|
|
t-value="o.move_line_ids._get_aggregated_product_quantities(except_package=True)"/>
|
|
<t t-if="move_lines or aggregated_lines" name="no_package_move_lines">
|
|
<t t-call="stock.stock_report_delivery_no_package_section_line"
|
|
name="no_package_section"/>
|
|
<t t-if="has_serial_number">
|
|
<tr t-foreach="move_lines" t-as="move_line">
|
|
<t t-call="stock.stock_report_delivery_has_serial_move_line"/>
|
|
</tr>
|
|
</t>
|
|
<t t-elif="aggregated_lines">
|
|
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
<!-- No destination packages -->
|
|
<t t-else="">
|
|
<!-- If printing lots/serial numbers => keep products in original lines -->
|
|
<t t-if="has_serial_number">
|
|
<tr t-foreach="o.move_line_ids" t-as="move_line">
|
|
<t t-call="stock.stock_report_delivery_has_serial_move_line"/>
|
|
</tr>
|
|
</t>
|
|
<!-- If not printing lots/serial numbers => merge lines with same product -->
|
|
<t t-else="" name="aggregated_move_lines">
|
|
<t t-set="aggregated_lines"
|
|
t-value="o.move_line_ids._get_aggregated_product_quantities()"/>
|
|
<t t-call="stock.stock_report_delivery_aggregated_move_lines"/>
|
|
</t>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
<t t-set="backorders"
|
|
t-value="o.backorder_ids.filtered(lambda x: x.state not in ('done', 'cancel'))"/>
|
|
<t t-if="o.backorder_ids and backorders">
|
|
<p class="mt-5">
|
|
<span>Remaining quantities not yet delivered:</span>
|
|
</p>
|
|
<table class="table table-sm" name="stock_backorder_table" style="table-layout: fixed;">
|
|
<thead t-attf-style="background-color:#{o.theme_id.base_color};color:#{o.theme_id.heading_text_color};">
|
|
<tr>
|
|
<th name="th_sb_product">
|
|
<strong>Product</strong>
|
|
</th>
|
|
<th/>
|
|
<th name="th_sb_quantity" class="text-center">
|
|
<strong>Quantity</strong>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<t t-foreach="backorders" t-as="backorder">
|
|
<t t-set="bo_lines"
|
|
t-value="backorder.move_ids.filtered(lambda x: x.product_uom_qty)"/>
|
|
<tr t-foreach="bo_lines" t-as="bo_line">
|
|
<td class="w-auto">
|
|
<span t-field="bo_line.product_id"/>
|
|
<p t-if="bo_line.description_picking != bo_line.product_id.name and bo_line.description_picking != bo_line.product_id.display_name">
|
|
<span t-field="bo_line.description_picking"/>
|
|
</p>
|
|
</td>
|
|
<td/>
|
|
<td class="text-center w-auto">
|
|
<span t-field="bo_line.product_uom_qty"/>
|
|
<span t-field="bo_line.product_uom"/>
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
<br/>
|
|
<br/>
|
|
<br/>
|
|
</t>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
</odoo>
|
|
|