From aa1c6f05c5e7d93fefb26dd634b1fc483fad7d9b Mon Sep 17 00:00:00 2001 From: William Braeckman Date: Mon, 4 Apr 2022 16:36:06 +0200 Subject: [PATCH] [FIX] stock: fix null value for product tracking Due to the recent changes of precompute. The `tracking` fields of `product.template` would never be filled with the default 'none' when the module was not loaded. This means that any new product.product demo/data would fail the upgrade scripts. TaskId-2675382 --- addons/stock/models/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index b86fa90d766..f2222e20714 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -638,7 +638,7 @@ class ProductTemplate(models.Model): ('serial', 'By Unique Serial Number'), ('lot', 'By Lots'), ('none', 'No Tracking')], - string="Tracking", required=True, + string="Tracking", required=True, default='none', # Not having a default value here causes issues when migrating. compute='_compute_tracking', store=True, readonly=False, precompute=True, help="Ensure the traceability of a storable product in your warehouse.") description_picking = fields.Text('Description on Picking', translate=True)