Steps to Reproduce:
- Activate packaging
- Create a storable product update on hand qty 1 package: "PACK6"
- Create a sale order with the product qty 1
- Confirm the order, picking will have a package already assigned
- Edit the sale order and set the product quantity to 0
Bug:
a new move will be created with negtaive quantity and merged with original
(correct behaviour)
but when the picking is confirmed an extra move will be created due to the
picking still having a package level set
Fix:
unlink the package level when its last linked SML is unlinked
opw-3597188
closesodoo/odoo#150939
X-original-commit: 4983923973bacbff84d67cdd442d4b6985f33577
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>