From 4fae8759ee633ed3c58ff6750cb9d895ac19dc65 Mon Sep 17 00:00:00 2001 From: Yoshi Tashiro Date: Wed, 26 Jan 2022 16:31:08 +0800 Subject: [PATCH] [FIX] stock_available_unreserved: pre_init_hook Before this commit, unreserved_quantity and contains_unreserved were not updated at install when there was quantity and not reserved_quantity. --- stock_available_unreserved/hooks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stock_available_unreserved/hooks.py b/stock_available_unreserved/hooks.py index 785ab2e79..a7a24089a 100644 --- a/stock_available_unreserved/hooks.py +++ b/stock_available_unreserved/hooks.py @@ -37,7 +37,6 @@ def add_field_unreserved_quantity(cr): """ UPDATE stock_quant SET unreserved_quantity = quantity - reserved_quantity - WHERE reserved_quantity > 0.01 """ ) @@ -59,6 +58,6 @@ def add_field_contains_unreserved(cr): cr.execute( """ UPDATE stock_quant - SET contains_unreserved = (reserved_quantity > 0.01); + SET contains_unreserved = (unreserved_quantity > 0.0); """ )