[12.0][FIX][stock_move_location] Planned transfer: quantity done

This commit is contained in:
Joan Sisquella
2019-11-07 16:45:19 +01:00
committed by Joan Sisquella
parent 360a273db8
commit cd787e41c8
2 changed files with 4 additions and 3 deletions

View File

@@ -106,7 +106,7 @@ class TestMoveLocation(TestsCommon):
self.assertEqual(len(picking.move_line_ids), 4)
self.assertEqual(
sorted(picking.move_line_ids.mapped("qty_done")),
[1, 1, 1, 123],
[0.0, 0.0, 0.0, 0.0],
)
def test_quant_transfer(self):

View File

@@ -83,7 +83,8 @@ class StockMoveLocationWizardLine(models.TransientModel):
def create_move_lines(self, picking, move):
for line in self:
values = line._get_move_line_values(picking, move)
if values.get("qty_done") <= 0:
if not self.env.context.get("planned") and \
values.get("qty_done") <= 0:
continue
self.env["stock.move.line"].create(
values
@@ -116,7 +117,7 @@ class StockMoveLocationWizardLine(models.TransientModel):
return 0
if self.env.context.get("planned"):
# for planned transfer we don't care about the amounts at all
return self.move_quantity
return 0.0
search_args = [
('location_id', '=', self.origin_location_id.id),
('product_id', '=', self.product_id.id),