From 6d73b70a58de21180e8f5ba324e889551a26c064 Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Wed, 25 Dec 2024 14:57:45 +0500 Subject: [PATCH] [OU-FIX] stock: do not try to compute quantity_done for canceled stock moves Otherwise UserError will be raised [1] [1] https://github.com/odoo/odoo/blob/0043634d87fdde1fa427eda90e444fe76767bacb/addons/stock/models/stock_move.py#L675-L676 --- openupgrade_scripts/scripts/stock/16.0.1.1/post-migration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openupgrade_scripts/scripts/stock/16.0.1.1/post-migration.py b/openupgrade_scripts/scripts/stock/16.0.1.1/post-migration.py index bbeb3188669..9ae89e49796 100644 --- a/openupgrade_scripts/scripts/stock/16.0.1.1/post-migration.py +++ b/openupgrade_scripts/scripts/stock/16.0.1.1/post-migration.py @@ -49,6 +49,7 @@ def _complete_stock_move_quantity_done_with_orm(env): """ SELECT move_id FROM stock_move_line + WHERE state != 'cancel' GROUP BY move_id HAVING COUNT(DISTINCT product_uom_id) > 1 AND SUM(qty_done) <> 0