8ada65ee2265a9b7e499f02a98b79b3af82f0883
The new randomly occurring runbot errors in pos/* can be reproduced by
performing quick successive clicks in numpad widget with the following form:
1. Press 'Price' button.
2. A number input.
3. Press 'Qty' button.
4. A number input.
The goal of the above steps is to set the price of the selected orderline
followed by setting the quantity. The result however is that the price
isn't changed but the quantity is changed to combined digits of the price
and quantity inputs. This is due to the implementation of the `NumberBuffer`
singleton which is used to abstract and take into account different sources of
user inputs -- via numpad widget, keyboard and barcode scanner.
Barcode scanner performs fast successive keyboard presses. To differentiate it
from normal keyboard input, we used `eventsBuffer` field of `NumberBuffer`
and store keyboard events there. Fast keyboard presses that stores more than
2 in the events are neglected by the buffer and is considered a barcode input.
In this commit, we save the `handler` that handles the keyboard events saved
in the `eventsBuffer`, then instead of only letting it to be invoked by the
setTimeout object, we allow the manual invoking of `handler` using the introduced
`capture` method. This method is called when the numpad mode is changed
(pressing Price, Discount or Qty button).
Additionally, we remove the use of 'useState' to prevent unnecessary rerender
of the component that uses the `NumberBuffer`.
closes odoo/odoo#56493
X-original-commit: a48d5a3599bff8f9f1446a5f7ad0ac9be0723478
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%