Skip to content

Commit 7ae62fa

Browse files
committed
[FIX]stock_ux: add origin condition to origin description
closes #858 X-original-commit: f65d74d Signed-off-by: Juan Carreras <jc@adhoc.com.ar>
1 parent 8ece707 commit 7ae62fa

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
@@ -111,7 +111,7 @@ def _get_aggregated_product_quantities(self, **kwargs):
111111
move_line_by_move = {}
112112
for sml in self:
113113
move = sml.move_id
114-
if move and move.origin_description:
114+
if move and move.origin_description and sml.picking_id.origin:
115115
move_line_by_move.setdefault(
116116
move.id,
117117
{
@@ -143,7 +143,8 @@ def _get_aggregated_properties(self, move_line=False, move=False):
143143
use_origin = (
144144
self.env["ir.config_parameter"].sudo().get_param("stock_ux.delivery_slip_use_origin", "False") == "True"
145145
)
146-
if use_origin:
146+
picking = move_line.picking_id if move_line else (move.picking_id if move else False)
147+
if use_origin and picking and picking.origin:
147148
move = move or move_line.move_id
148149
uom = move.product_uom or move_line.product_uom_id
149150
reference = move.product_id.display_name

0 commit comments

Comments
 (0)