From 81189c9759beb5319caf6f66ccf6bf6323d78e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:58:28 +0100 Subject: [PATCH 1/2] Disable change on system product_nature element finished value 1 is associed to bom feature (and factory module) it's better to disable the change of the 2 initial value (consider it as system) --- htdocs/admin/dict.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d895854ab2c..5a3364e8077 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -13,6 +13,7 @@ * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2019-2022 Frédéric France * Copyright (C) 2020-2022 Open-Dsi + * Copyright (C) 2024 Charlene Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2129,7 +2130,12 @@ if ($id > 0) { if ($tabname[$id] == "c_actioncomm") { $canbemodified = 1; } - + + if ($tabname[$id] == "c_product_nature" && in_array($obj->code, array(0, 1))) { + $canbedisabled = 0; + $canbemodified = 0; + $iserasable = 0; + } // Build Url. The table is id=, the id of line is rowid= $rowidcol = empty($tabrowid[$id]) ? 'rowid' : $tabrowid[$id]; // If rowidcol not defined From 979003e539023e3cbc18c0396f0c11ddc341e816 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Mar 2024 14:15:47 +0100 Subject: [PATCH 2/2] Update dict.php --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5a3364e8077..da9b0271b15 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2130,7 +2130,7 @@ if ($id > 0) { if ($tabname[$id] == "c_actioncomm") { $canbemodified = 1; } - + if ($tabname[$id] == "c_product_nature" && in_array($obj->code, array(0, 1))) { $canbedisabled = 0; $canbemodified = 0;