[FIX] stock: Lot/Serial Number not displayed

The field lot_name is not initialised in many cases.

Steps to reproduce the bug:

- Set your user in the group called "Display Serial & Lot Number in Delivery Slips"
- Create a new stockable product P with setting tracking "by unique serial number"
- Create 10 serial numbers for P
- Purchase 10 units of P and select the 10 serial numbers created
- Create a SO where I selected 1 unit of P with its serial number and confirm it
- Go to the delivery slip and print the delivery slip

Bug:

The serial number was not printed in the delivery slip.

opw:1900735

closes odoo/odoo#28076
This commit is contained in:
Goffin Simon
2018-10-24 08:11:32 +00:00
parent 796b45afd6
commit 274f956f8d
+4 -1
View File
@@ -94,9 +94,12 @@
<span t-field="move_line.product_id.sudo().description_pickingin"/>
</p>
</td>
<td t-if="has_serial_number" groups="stock.group_lot_on_delivery_slip">
<td t-if="has_serial_number and move_line.lot_name" groups="stock.group_lot_on_delivery_slip">
<span t-field="move_line.lot_name"/>
</td>
<td t-else="" groups="stock.group_lot_on_delivery_slip">
<span t-field="move_line.lot_id.name"/>
</td>
<td class="text-center">
<span t-field="move_line.qty_done"/>
<span t-field="move_line.product_uom_id"/>