From b3ca58d2d0ae2f5fb38b7328664e7869a8b1ac3d Mon Sep 17 00:00:00 2001 From: zuiko Date: Wed, 9 Dec 2020 21:16:25 +0100 Subject: [PATCH] Update html.form.class.php Complete the Fix to #15565 Enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently. Answer to Eldy, https://github.com/Dolibarr/dolibarr/pull/15704#discussion_r538763166 In fact the change alone to htdocs/core/lib/ajax.lib.php is not, for me, sufficient to fix the issue. if $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, the combo remains even if the product is alone. So I recommend that the code is $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, (wihout combo) for product selection only for customer order filling because for this usage the the probability is higher to use a barcode scanner. It is less relevant for filling supplier orders (which are not usually entered by barcode scanner), because the combo gives verification information which then disappears. (This is especially true for the purchase price, which is not pre-filled in the box for the moment I tested(?). --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8faad1f92e9..8c4d24c64cf 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1995,7 +1995,7 @@ class Form if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) { $urloption .= '&socid='.$socid; } - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, $ajaxoptions); if (!empty($conf->variants->enabled)) { $out .= '