Problem in entering new item in sales invoice


There is a problem when typing the item code and pressing enter in the sales invoice item table, it is opening the item table at the first item in the table. How can we avoid this? Same thing if I entered the barcode in the scan barcode field.
This is happening if I clicked on the small arrow at the item table of the item record to see the detailed information of the item, then this problem is appearing.

I am using erpnext version 11


Samthing is happening if I entered the quantity and pressed enter, it will open the window of the first time in the table.

How to avoid this and overcome on it?
This thing is causing confusion for the user.


Instead of using the “Enter” key, use the “TAB” key. This will fill the field and advance to the next field without opening the window.

Your barcode scanner should also be programmable to change the suffux character from “Enter” (which is actually 2 characters, the carriage return and a line feed), to the “TAB” key instead.

For my rolling inventory carts that I use in the warehouse, I also have a laminated card on the cart that has Code128 barcodes for such things as TAB, ENTER, and SHIFT TAB (which takes you back one field). This makes it much easier for the guys loading trucks to navigate the screen without having to drop the scanner and use the keyboard. There is also a USB numeric keypad attached that allows them to key in numbers when needed because the laptop keyboard is far to crowded to try to navigate when you are in a hurry.


Hello @bkm
I think that you are talking about something and I am talking about other thing.
The scan barcode that I was mean it, is not the device that you are using it to scan the barcode, but it is a field existed in the sales invoice called: scan barcode as you can see in the below image:


Using this field, for sure that pressing on TAB is not going to resolve the problem, it is going to take me to the item table of the first row. Also, pressing ENTER is going to take me to the same place if we were showing the item table previously (please come back to my first post).

Also, if you are talking about using TAB within the item table it self (and not from the scan barcode field), this will cause the following problem:

  • If we were typing (or scanning) the barcode of the item, then it is required to press on ENTER first to take it, if TAB is pressed, it will not take it and will move to the quantity but with blank item code.

  • If we were typing (or scanning) the item code of the item, then by pressing on TAB, it will take it, but it will be required to press another TAB (after some delay, let us say 1 or 2 seconds and sometimes 3 seconds, because this 1 or 2 second is required to insert the quantity number automatically), so the other TAB will take us to the quantity and the default quantity which is the value 1 will be selected, so we can enter the new quantity. But, if the second TAB pressed and still the quantity is not inserted (because there is a small delay to insert the quantity and the rate), then we have to use again the mouse to select the quantity value that was inserted by default and place the new quantity.

There is another problem now:
scan barcode field (I am saying field and not the device), need to press ENTER after each scan, and you said that we have to program the scanner to enter TAB after the scan which can be used in the item barcode, so that will required to have two scanners, one to be used when we are entering the data from the scan barcode field and one for entering the item code in the item table which will add the TAB to the item code. And in case of scanning barcode in the item code field, then we have to press ENTER. So too much confusion.

Let us ask simple question:
Why it is entering the item table when pressing ENTER? No need for this. Is it bug?
Simply, when it is required to open the item table, we can press on the small arrow that is existed as last column on each item record.

Thank you and hopefully I can find a help.

Hello @bkm

Have you used the scan barcode field that shown in the picture?


Typing TAB after the barcode scanning is not the right way, because it will take you to the item table at the first record.

Really I do not know why the Item Table is opened and what is the target of this? Is it bug?


For reference, I worked around this with a Custom Script. I was having the exact same issue with tab and enter.

frappe.ui.form.on('Purchase Order', {
	onload(frm) {
		frm.fields_dict.scan_barcode.$input.on('keydown', function (e) {
            if (e.keyCode === 9 || e.keyCode === 13) {
                return false;