Skip to content

[FIX] purchase_stock_ux: don't cancel done downstream moves when dele…#337

Open
fw-bot-adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-18.0-h-118671-jc-6420-fw
Open

[FIX] purchase_stock_ux: don't cancel done downstream moves when dele…#337
fw-bot-adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-18.0-h-118671-jc-6420-fw

Conversation

@fw-bot-adhoc

Copy link
Copy Markdown

…ting a PO line

Standard purchase_stock PurchaseOrderLine.unlink() calls move_dest_ids._action_cancel() for propagate_cancel lines without filtering out moves already in 'done' state. When an MTO line's customer delivery was already shipped from on-hand stock, deleting the purchase line raised 'You cannot cancel a stock move that has been set to Done', blocking the edition of the RFQ.

button_cancel() already guards against this (it filters state != 'done' before cancelling). Mirror that protection in unlink(): detach the already-done downstream moves before the standard unlink so they are no longer cancelled. The delivered move stays untouched.

Adds a regression test reproducing the case.

Forward-Port-Of: #333

…ting a PO line

Standard purchase_stock PurchaseOrderLine.unlink() calls
move_dest_ids._action_cancel() for propagate_cancel lines without
filtering out moves already in 'done' state. When an MTO line's
customer delivery was already shipped from on-hand stock, deleting the
purchase line raised 'You cannot cancel a stock move that has been set
to Done', blocking the edition of the RFQ.

button_cancel() already guards against this (it filters state != 'done'
before cancelling). Mirror that protection in unlink(): detach the
already-done downstream moves before the standard unlink so they are no
longer cancelled. The delivered move stays untouched.

Adds a regression test reproducing the case.

X-original-commit: 3611ad5
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@fw-bot-adhoc

Copy link
Copy Markdown
Author

@jcadhoc @mav-adhoc cherrypicking of pull request #333 failed.

stdout:

Auto-merging purchase_stock_ux/__manifest__.py
CONFLICT (content): Merge conflict in purchase_stock_ux/__manifest__.py
Auto-merging purchase_stock_ux/models/purchase_order_line.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @roboadhoc.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants