[IMP] stock_picking_batch_collect: collected checks on transfers, ordered quantity, delivery slips report

- The collected checks also apply to transfers outside a batch, opt-in per
  operation type ("Require Collected Lines"), with the batch restrictions of
  the settings. A per-product toggle in the transfer's Operations tab collects
  all its lines.
- Read-only ordered quantity from the sale line on every batch and transfer
  view, since the weighed demand overwrites it. Adds a dependency on
  sale_stock; a migration fills it in the summary of open batches.
- "Delivery Slips" report on the batch: all its delivery slips in one PDF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GitHub Copilot 2026-10-04 14:32:38 +02:00
parent 76dc355c6c
commit 9c81cb986d
Signed by: snt
GPG key ID: A9FD34930EADBE71
24 changed files with 630 additions and 39 deletions

View file

@ -1,6 +1,7 @@
# Copyright 2026 Criptomart
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api
from odoo import fields
from odoo import models
@ -35,6 +36,23 @@ class StockMoveLine(models.Model):
copy=False,
)
sale_ordered_qty = fields.Float(
string="Ordered Quantity",
digits="Product Unit of Measure",
compute="_compute_sale_ordered_qty",
)
@api.depends("move_id.sale_ordered_qty", "move_id.product_uom", "product_uom_id")
def _compute_sale_ordered_qty(self):
for line in self:
move = line.move_id
if move.sale_ordered_qty and line.product_uom_id:
line.sale_ordered_qty = move.product_uom._compute_quantity(
move.sale_ordered_qty, line.product_uom_id, round=False
)
else:
line.sale_ordered_qty = 0.0
def write(self, vals):
res = super().write(vals)
if vals.get("is_collected"):