[IMP] stock_picking_batch_collect: demanded quantity on the move line lists
Some checks failed
CI / lint (pull_request) Successful in 32s
CI / test (pull_request) Failing after 3m15s
CI / review (pull_request) Has been skipped

The move lists already show the demand, the move line ones do not: the
detailed operations of the batch and of the transfer, and the operator
(Basket Assembly) view. Adds a read-only column with the demand of the
line's move, in the unit of the line, next to the ordered quantity.

Closes #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GitHub Copilot 2026-10-10 18:34:56 +02:00
parent fac8299c9c
commit 18cfd38347
Signed by: snt
GPG key ID: A9FD34930EADBE71
11 changed files with 93 additions and 1 deletions

View file

@ -110,6 +110,50 @@ class TestPickingCollected(TransactionCase):
self.assertEqual(move.sale_ordered_qty, 2.0)
self.assertEqual(move.move_line_ids.sale_ordered_qty, 2.0)
def test_move_line_demand_follows_the_move(self):
picking = self._create_sale_picking(2.0)
move = picking.move_ids
line = move.move_line_ids
self.assertEqual(line.move_demand_qty, 2.0)
gram = self.env.ref("uom.product_uom_gram")
line.product_uom_id = gram
self.assertEqual(line.move_demand_qty, 2000.0)
move.product_uom_qty = 3.0
self.assertEqual(line.move_demand_qty, 3000.0)
def test_move_line_demand_without_sale(self):
"""Unlike the ordered quantity, the demand needs no sale order."""
picking = self.env["stock.picking"].create(
{
"picking_type_id": self.picking_type_out.id,
"location_id": self.stock_location.id,
"location_dest_id": self.env.ref("stock.stock_location_customers").id,
"move_ids": [
Command.create(
{
"name": self.product.name,
"product_id": self.product.id,
"product_uom_qty": 4.0,
"product_uom": self.product.uom_id.id,
"location_id": self.stock_location.id,
"location_dest_id": self.env.ref(
"stock.stock_location_customers"
).id,
}
)
],
}
)
picking.action_confirm()
picking.action_assign()
line = picking.move_ids.move_line_ids
self.assertEqual(line.move_demand_qty, 4.0)
self.assertEqual(line.sale_ordered_qty, 0.0)
def test_batch_summary_ordered_quantity(self):
pickings = self._create_sale_picking(2.0) | self._create_sale_picking(3.0)
batch = self.env["stock.picking.batch"].create(