From ba7e21cc322c719966a9a112fb83adc6eaddc920 Mon Sep 17 00:00:00 2001 From: Bastian Guenther Date: Fri, 22 Nov 2024 10:06:50 +0100 Subject: [PATCH] [FIX] product_uom_measure_type: Fixed the issue, that the module cannot be installed on migrated databases which already have a column 'measure_type' --- product_uom_measure_type/hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/product_uom_measure_type/hooks.py b/product_uom_measure_type/hooks.py index 48a1463f316a..9e951008862e 100644 --- a/product_uom_measure_type/hooks.py +++ b/product_uom_measure_type/hooks.py @@ -17,7 +17,7 @@ def pre_init_hook(cr): cr.execute( """ ALTER TABLE uom_category - ADD column measure_type character varying; + ADD column IF NOT EXISTS measure_type character varying; """ ) @@ -50,7 +50,7 @@ def pre_init_hook(cr): cr.execute( """ ALTER TABLE uom_uom - ADD column measure_type character varying; + ADD column IF NOT EXISTS measure_type character varying; """ ) @@ -67,7 +67,7 @@ def pre_init_hook(cr): cr.execute( """ ALTER TABLE product_template - ADD column uom_measure_type character varying; + ADD column IF NOT EXISTS uom_measure_type character varying; """ )