[FIX] stock: To avoid singleton error

In this way, it ensures that a single record is used when calling
the function _get_move_values

opw:806668
This commit is contained in:
Florent de Labarre
2018-01-23 09:35:42 +01:00
committed by Goffin Simon
parent 296c5a2106
commit b3b8a471cc
+2 -2
View File
@@ -454,9 +454,9 @@ class InventoryLine(models.Model):
continue
diff = line.theoretical_qty - line.product_qty
if diff < 0: # found more than expected
vals = self._get_move_values(abs(diff), line.product_id.property_stock_inventory.id, line.location_id.id)
vals = line._get_move_values(abs(diff), line.product_id.property_stock_inventory.id, line.location_id.id)
else:
vals = self._get_move_values(abs(diff), line.location_id.id, line.product_id.property_stock_inventory.id)
vals = line._get_move_values(abs(diff), line.location_id.id, line.product_id.property_stock_inventory.id)
move = moves.create(vals)
if diff > 0: