From 8214a6ce5b4dfb78bead18d57bdbf7789950fa24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 22 May 2013 19:02:25 +0200 Subject: [PATCH] Don't create duplicate move supply_on_sale could be changed between two calls on get_move so we must also check if a purchase request is not yet created. review857002 --- sale.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sale.py b/sale.py index ca3c5ab5f3..ff52cc23e7 100644 --- a/sale.py +++ b/sale.py @@ -82,7 +82,8 @@ class SaleLine: def get_move(self, shipment_type): move = super(SaleLine, self).get_move(shipment_type) if (shipment_type == 'out' - and self.supply_on_sale): + and (self.supply_on_sale + or self.purchase_request)): if self.purchase_request_state in ('', 'requested'): return return move