After yearly inventory i have a lot of mowes with reference to inventory but they are not paired wit it (inventory_adjustment_id on stock.move.lines is Null.
The problem is that filtered changes orders
eg:
moves = record_moves.search(
[
("product_id", "=", rec.product_id.id),
("lot_id", "=", rec.lot_id.id),
"|",
("location_id", "=", rec.location_id.id),
("location_dest_id", "=", rec.location_id.id),
],
order="create_date asc",
)
returns
stock.move.line(64837, 483782, 653681, 655690, 661947, 1176881)
and after filtered it gives
stock.move.line(64837, 483782, 1176881, 653681, 655690, 661947)
move 1176881 is proper one but to write it takes inventory_adjustment_id 661947 which is in some cases it is (but not always) 'Product Quantity Confirmed' with 0 quantity.
can You modify it and add .sorted at the end
moves = record_moves.search(
[
("product_id", "=", rec.product_id.id),
("lot_id", "=", rec.lot_id.id),
"|",
("location_id", "=", rec.location_id.id),
("location_dest_id", "=", rec.location_id.id),
],
order="create_date asc",
).filtered(
lambda x, rec=rec: not x.company_id.id
or not rec.company_id.id
or rec.company_id.id == x.company_id.id
).sorted(key=lambda m: (m.create_date or fields.Datetime.now(), m.id))
stock-logistics-warehouse/stock_inventory/models/stock_quant.py
Line 35 in df5af0d
After yearly inventory i have a lot of mowes with reference to inventory but they are not paired wit it (
inventory_adjustment_idonstock.move.linesisNull.The problem is that filtered changes orders
eg:
returns
stock.move.line(64837, 483782, 653681, 655690, 661947, 1176881)and after filtered it gives
stock.move.line(64837, 483782, 1176881, 653681, 655690, 661947)move
1176881is proper one but to write it takes inventory_adjustment_id661947which is in some cases it is (but not always)'Product Quantity Confirmed'with 0 quantity.can You modify it and add
.sortedat the end