Skip to content

Commit f65d74d

Browse files
committed
[FIX]stock_ux: add origin condition to origin description
closes #857 Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
1 parent f4becaf commit f65d74d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

stock_ux/models/stock_move_line.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _get_aggregated_product_quantities(self, **kwargs):
124124
move_line_by_move = {}
125125
for sml in self:
126126
move = sml.move_id
127-
if move and move.origin_description:
127+
if move and move.origin_description and sml.picking_id.origin:
128128
move_line_by_move.setdefault(
129129
move.id, {"description": move.origin_description, "product_id": sml.product_id.id}
130130
)
@@ -152,7 +152,8 @@ def _get_aggregated_properties(self, move_line=False, move=False):
152152
use_origin = (
153153
self.env["ir.config_parameter"].sudo().get_param("stock_ux.delivery_slip_use_origin", "False") == "True"
154154
)
155-
if use_origin:
155+
picking = move_line.picking_id if move_line else (move.picking_id if move else False)
156+
if use_origin and picking and picking.origin:
156157
move = move or move_line.move_id
157158
uom = move.product_uom or move_line.product_uom_id
158159
name = move.product_id.display_name

0 commit comments

Comments
 (0)