New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently #15565
Comments
You don't need the mouse. You can use the down arrow on your keyboard. |
Yes, down arrow works but not with the barcode reader ;) |
I post an answer on forum how to autoselect if only one choice without tab enter etc |
Thanks to frederic34, I continued my investigations...
But functionally it is perfect. Then any change in the product module's parameters causes the complete malfunction of the barcode entry by hand shower.
If, with the patch, I go back to my original configuration, the performances are not really better (4s for the ajax list + around 10s for the product to be selected, with a barcode reader with CR/LF). I made tests on Chrome and Edge, in the case of the display of all the products by ajax. Here it's just worse, neither of them is able to display the list, the page gets stuck. They are unusable in this configuration. And then also
Precision, my config is: So here is my analysis, I hope it can help to solve this problem which seems to me to revolve around ajax performances for a wide range of products (>10K)... |
I found a solution that works for CR/LF showerheads (and others) but I don't know if it's very elegant (it would be more flexible and safer if the change is activated on a parameter of the ajax_autocompleter function) and if it has no side effect elsewhere. Of course I kept the modifications of the /core/class/html.form.class.php file. On ligne 2045 replaced 0 by 1 On ligne 2797 replaced 0 by 1 The only test I did was with the data from the Products module: In this case the performance is excellent, the display is instantaneous (even for more than 10K products), whether you select the product by hand or with the hand shower. I did not see any disadvantage, for this field, to ignore the ENTER key. To be tested/advanced, therefore... |
For information some have developped some free dedicated libraries for barcode readers. |
From PR Dolibarr#15565 At first suggested change by frederic34 on French Forum In order to enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently, a part of the job is that the product must be automatically selected if it is unique and it's allways searching product with barcode reader if this product exists. I did not find any disadvantage in case of manual entry of the product reference. To complete this enhencement, another change is necessary on /core/lib/ajax.lib.php in function ajax_autocompleter.
From PR Dolibarr#15565 In order to enhance behaviour to select product on customer/supplier order to be able to use barcode reader efficiently. If /core/class/html.form.class.php has been changed in order to have the unique product automatically selected (by barcode reader), we need to disable the ENTER (CR/LF) key eventually and most often sent by the barcode reader in order the selection not be erased by this too early ENTER (CR/LF). Indeed, if not, the CR/LF is sent before the selection is effective.
From PR Dolibarr#15565 In order to enhance behaviour to select product on customer/supplier order to be able to use barcode reader efficiently. If /core/class/html.form.class.php has been changed in order to have the unique product automatically selected (by barcode reader), we need to disable the ENTER (CR/LF) key eventually and most often sent by the barcode reader in order the selection not be erased by this too early ENTER (CR/LF). Indeed, if not, the CR/LF is sent before the selection is effective.
From PR Dolibarr#15565 At first suggested change by frederic34 on French Forum In order to enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently, a part of the job is that the product must be automatically selected if it is unique and it's allways searching product with barcode reader if this product exists. I did not find any disadvantage in case of manual entry of the product reference. To complete this enhencement, another change is necessary on /core/lib/ajax.lib.php in function ajax_autocompleter.
From PR Dolibarr#15565 In order to enhance behaviour to select product on customer/supplier order to be able to use barcode reader efficiently. If /core/class/html.form.class.php has been changed in order to have the unique product automatically selected (by barcode reader), we need to disable the ENTER (CR/LF) key eventually and most often sent by the barcode reader in order the selection not be erased by this too early ENTER (CR/LF). Indeed, if not, the CR/LF is sent before the selection is effective.
Please check if commit 85bb3fa is enough. |
Hi eldy, but my users gave me this testimony: the value 1 for select is relevant for entering customer orders with a barcode reader, but it is less relevant for entering supplier orders (which are not usually entered by hand shower), 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 (is this voluntary?). So on my side, I would keep select = 1 for customer orders and select = 0 for supplier orders. For the moment, I didn't found how to reopen a closed pull request, sorry, I try ;-) |
Complete the Fix to Dolibarr#15565 Enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently. Answer to Eldy, Dolibarr#15704 (comment) 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(?).
Completes Fix Dolibarr#15565 Enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, becomes $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 1, to speed up customer order filling with product selected by barcode readers.
V13 Update html.form.class.php to complete Fix #15565 Enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently
V13 fix reported on V12 branch Enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently Feature request Dolibarr#15565
V13 fix reported on V12 branch Enhanced behaviour to select product on customer/supplier order to be able to use barcode reader efficiently Feature request Dolibarr#15565
Feature Request
[Enhanced behaviour to select product on customer order (may be supplier also?)
The first product in the list which appears, typing, some characters, must be pre-selected by default]
Use case
[On my Dolibarr 12.0.3 on customer order creation, when I begin to type some letters or numbers, some corresponding products appear but no one is selected and even if the first is correct I have to select it by my mouse and not typing ENTER.
This behaviour make my barcode reader unusable when it send CR/LF end of line characters]
[On this demo site with the same Dolibarr level the behaviour is completely different and the first line is selected, so you can type ENTER and that is]
[I don't know if they changed something on their Dolibarr but I think this behaviour is much more better for productivity purpose.
Could it be possible to get systematically this behaviour on Dolibarr?
May be is there some parameter somewhere to do that? But I did not find it.
May be it's something different on javascript?]
Discussion on French forum here
The text was updated successfully, but these errors were encountered: