From 7ad70c7c218410575065b6fff36acfe9604ead0e Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Mon, 7 Dec 2020 14:33:44 +0100 Subject: [PATCH 1/2] Update product.class.php Added Hidden Option STOCK_DEFAULT_BATCH, in order to replace the default '000000' batchnumber for the existing stock when batchnumbers are enabled for a product. --- htdocs/product/class/product.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ac931da8702..9abd1d82da5 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -934,6 +934,7 @@ class Product extends CommonObject if ($this->hasbatch() && !$this->oldcopy->hasbatch()) { //$valueforundefinedlot = 'Undefined'; // In previous version, 39 and lower $valueforundefinedlot = '000000'; + if ($conf->global->STOCK_DEFAULT_BATCH) $valueforundefinedlot = $conf->global->STOCK_DEFAULT_BATCH; dol_syslog("Flag batch of product id=".$this->id." is set to ON, so we will create missing records into product_batch"); From 669205af1c05f879a59f57a2160b7515991d964b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Dec 2020 19:02:49 +0100 Subject: [PATCH 2/2] Update product.class.php --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9abd1d82da5..ccca1a85f47 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -934,7 +934,7 @@ class Product extends CommonObject if ($this->hasbatch() && !$this->oldcopy->hasbatch()) { //$valueforundefinedlot = 'Undefined'; // In previous version, 39 and lower $valueforundefinedlot = '000000'; - if ($conf->global->STOCK_DEFAULT_BATCH) $valueforundefinedlot = $conf->global->STOCK_DEFAULT_BATCH; + if (!empty($conf->global->STOCK_DEFAULT_BATCH)) $valueforundefinedlot = $conf->global->STOCK_DEFAULT_BATCH; dol_syslog("Flag batch of product id=".$this->id." is set to ON, so we will create missing records into product_batch");