[FIX] stock: safely reference move source in reception report labels
Commit d6abfbade9fb7f6dd6b3253551c559b1c7e6ece5 made it so we directly reference a move's source origin via _get_source_document(). Normally this is fine when the labels are created because labels would never be created for a move without a source document, but this isn't safe when the label is accessed via another way (e.g. test_reports). Therefore, let's add in a check to prevent a error from trying to access False.name. closes odoo/odoo#79585 X-original-commit: 8abba9c3c0c48241e017e87045f392dc403a28e9 Signed-off-by: Arnold Moyaux <arm@odoo.com> Signed-off-by: Tiffany Chang <tic@odoo.com>
This commit is contained in:
@@ -10,10 +10,11 @@
|
||||
<t t-foreach="range(len(docs))" t-as="index">
|
||||
<t t-set="move" t-value="docs[index]"/>
|
||||
<t t-set="qty" t-value="qtys[index]"/>
|
||||
<t t-set="source" t-value="move._get_source_document()"/>
|
||||
<t t-foreach="range(qty)" t-as="j">
|
||||
<div class="o_label_page o_label_dymo">
|
||||
<div t-out="move.product_id.display_name"/>
|
||||
<div t-out="move._get_source_document().name"/>
|
||||
<div t-if="source" t-out="source.name"/>
|
||||
<div class="address"
|
||||
t-if="move.picking_id and move.picking_id.partner_id"
|
||||
t-field="move.picking_id.partner_id"
|
||||
|
||||
Reference in New Issue
Block a user