mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[12.0][FIX][stock_move_location] Planned transfer: quantity done
This commit is contained in:
committed by
Joan Sisquella
parent
360a273db8
commit
cd787e41c8
@@ -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):
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user