Skip to content
Snippets Groups Projects
Commit ca7d5701 authored by Touati Djamel (otd)'s avatar Touati Djamel (otd)
Browse files

[FIX] sale_stock: prevent cancelling of pending deliveries


Steps to reproduce the bug:
- Install sale and inventory
- Create a SO with Qty 10 and confirm it
- Go to the delivery
- Make partial delivery of 5 units and create back-order of remaining 5 units.
- the status of backorder is “waitting”
- Get back to the sale order and cancel it
- the wizard “sale_order_cancel” is displayed, which gives a reminder of some partial deliveries are already done and asks to confirm the cancellation of SO
- Do not confirm the cancellation of SO and click on the cancel button
- Go to the delivery
- The pending deliveries are cancelled

Problem:
The `"action_cancel"` function in the `"sale_order"` model is first called to cancel pending deliveries,
then the `"action_cancel"` function of the `"sale"` model is called, but in that we check if whether one of the deliveries
is already completed in order to display the wizard.

But if the customer clicks the cancel button in the wizard, the SO will not be canceled, but the pending deliveries will already be.

Solution:
Check in the `"action_cancel"` function of the `"sale.order"` model if whether one of the deliveries is already been completed,
if so, do not cancel the pending deliveries and wait for user confirmation in the wizard.

opw-2623404

closes odoo/odoo#75949

Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
parent 198019b5
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment