From c9d9576c913ede7dccaed7331b02810a3dcf5d7b Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Wed, 6 Sep 2023 10:28:49 +0200 Subject: [PATCH] Not add origin in case origin is stock.order_point,-1 (origin is str) #162129 --- operation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/operation.py b/operation.py index f5f1473..80dc377 100644 --- a/operation.py +++ b/operation.py @@ -599,8 +599,10 @@ class CreatePurchase(metaclass=PoolMeta): line = super().compute_purchase_line(key, requests, purchase) origins = [k[0] for k in Line.get_origin()] - for origin in [request.origin for request in requests if request.origin]: + # not add in case origin is stock.order_point,-1 (str) + if isinstance(origin, str): + continue if origin.__name__ in origins: line.origin = origin break