Skip to content

Commit

Permalink
[FIX] stock: Delivery Slip
Browse files Browse the repository at this point in the history
- Create a picking to deliver 10 units, save
- Edit and change to 12 units
- Print the Delivery Slip => the qty is 10
- Validate the picking with 12 units
- Print the Delivery Slip => the qty is still 10

The use of `ordered_qty` is misleading, since it corresponds to the qty
ordered at creation.

Backport of 0a2999c

opw-1825396
  • Loading branch information
nim-odoo committed Mar 21, 2018
1 parent b200f02 commit 65bad81
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions addons/stock/report/report_deliveryslip.xml
Expand Up @@ -53,20 +53,19 @@
<thead>
<tr>
<th><strong>Product</strong></th>
<th><strong>Ordered Quantity</strong></th>
<th><strong>Quantity</strong></th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.move_lines" t-as="move">
<td><span t-field="move.product_id"/></td>
<td>
<span t-field="move.ordered_qty"/>
<span t-field="move.product_uom_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.pack_operation_ids">
<t t-set="has_serial_number" t-value="o.pack_operation_ids.filtered('pack_lot_ids')" groups="stock.group_production_lot"/>
<thead>
Expand All @@ -75,10 +74,7 @@
<th name="lot_serial" t-if="has_serial_number">
<span class="pull-left">Lot/Serial Number</span>
</th>
<th class="text-center"><strong>Ordered Quantity</strong></th>
<th t-if="any([pack_operation.state == 'done' for pack_operation in o.pack_operation_ids])" class="text-right">
<strong>Delivered Quantity</strong>
</th>
<th class="text-center"><strong>Quantity</strong></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -110,18 +106,6 @@
<td class="text-center">
<span t-if="pack_operation.package_id">:</span>
<span t-field="pack_operation.package_id"/>
<span t-field="pack_operation.ordered_qty"/>
<t t-if="pack_operation.linked_move_operation_ids">
<span t-field="pack_operation.linked_move_operation_ids[0].move_id.product_uom"></span>
</t>
<t t-else="1">
<span t-field="pack_operation.product_uom_id"></span>
</t>
</td>
<td class="text-right" t-if="pack_operation.state == 'done'">
<t t-if="pack_operation.ordered_qty != pack_operation.qty_done_uom_ordered">
<t t-set="backorder" t-value="True"/>
</t>
<span t-field="pack_operation.qty_done_uom_ordered"/>
<t t-if="pack_operation.linked_move_operation_ids">
<span t-field="pack_operation.linked_move_operation_ids[0].move_id.product_uom"></span>
Expand All @@ -137,7 +121,7 @@
This shipment is a backorder of <t t-esc="o.backorder_id.name"/>.
</p>
<p>
<t t-if="backorder">
<t t-if="o.search([('backorder_id', '=', o.id), ('state', 'not in', ['cancel', 'done'])])">
All items couldn't be shipped, the remaining ones will be shipped as soon as they become available.
</t>
</p>
Expand Down

0 comments on commit 65bad81

Please sign in to comment.