Skip to content

[ADD] purchase_stock_ux: mass cancellation of remaining qty to receive#342

Open
jcadhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-t-52215-jc
Open

[ADD] purchase_stock_ux: mass cancellation of remaining qty to receive#342
jcadhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-t-52215-jc

Conversation

@jcadhoc

@jcadhoc jcadhoc commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Adds a wizard to cancel the remaining quantity to receive on all lines of one or more purchase orders in a single operation.

  • New transient model purchase.order.cancel.remaining (+ form with confirmation).
  • Exposed as a contextual action ("Mass cancellation of remaining quantities") bound to purchase.order, available from the list and form action menu.
  • It collects the order lines whose receipt_status is pending or partial and applies the existing per-line button_cancel_remaining().

Why

There was no way to cancel only the remaining qty to receive of a PO when a vendor delivers partially and the rest won't arrive — the order stayed open indefinitely or had to be cancelled and recreated. The per-line button_cancel_remaining already existed; this adds the order-level (mass) counterpart, mirroring sale.order.cancel.remaining in sale_stock_ux.

Out of scope: remaining qty to invoice (only qty to receive is handled).

How it works

Reuses button_cancel_remaining(), which sets the line product_qty to qty_received + qty_returned; Odoo then cancels the pending moves. Lines already fully received are ignored, and each cancelled line is logged in the chatter.

Test plan

  1. Confirm a PO with several lines.
  2. Receive one line partially, leave the rest pending.
  3. Order action menu → Mass cancellation of remaining quantities → Confirm.
  4. Expected: all lines with remaining go to receipt_status = full (ordered qty drops to received qty), pending receptions are cancelled, and the chatter logs the qty change per line. Already-received and already-invoiced quantities are untouched.

Task 52215.

Add a 'purchase.order.cancel.remaining' wizard, available from the
purchase order action menu, that cancels the remaining qty to receive
on every order line with a pending/partial receipt in a single
operation. It reuses the existing per-line button_cancel_remaining,
mirroring the sale.order.cancel.remaining wizard from sale_stock_ux.

Task 52215.
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants