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
This commit is contained in:
Cédric Krier committed 2013-05-22 19:02:25 +02:00
1 parent d27eabfc90
commit 8214a6ce5b
1 file changed
+2 -1
+2 -1
View File
@@ -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