[FIX] mrp: False barcode

- Create a MO for a product tracked by S/N
- Perform the MO
- Print the 'Finished Product Label (PDF)'

The barcode printed is `False`.

If the S/N is not set on the `move_line`, we should fall back on
`lot_id.name`.

opw-2228337

closes odoo/odoo#48949

X-original-commit: fb69b5a99becd92ee0ee7698709da05a0b33850f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-04-03 09:41:23 +00:00
parent 6c4e4981bc
commit bc129637bb
@@ -152,7 +152,7 @@
<tr>
<td class="text-center align-middle">
<t t-if="move_line.lot_name or move_line.lot_id">
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s&amp;humanreadable=1' % ('Code128', move_line.lot_name, 600, 150)" style="width:100%;height:4rem" alt="Barcode"/>
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', move_line.lot_name or move_line.lot_id.name, 600, 150)" style="width:100%;height:4rem" alt="Barcode"/>
<span t-esc="move_line.lot_name or move_line.lot_id.name"/>
</t>
<t t-else="">