summaryrefslogtreecommitdiff
path: root/addons/barcodes/static/src
AgeCommit message (Collapse)Author
2020-09-07[FIX] *: typos and english incoherencesVictor Feyens
Mainly transifex issues but also some errors found through 'grep' checks. Fix typos and obscure english strings in xml contents, fields strings/helps, some docstrings, ... ensuring correct translations base (and fallback when translations isn't available). closes odoo/odoo#57206 Related: odoo/enterprise#13032 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-06-12[IMP] *: update notifications to optional titleJulien Mougenot
closes odoo/odoo#52826 Related: odoo/enterprise#11084 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-03-31[IMP] various: Replace incorrect use of "edition"Tiffany Chang (tic)
"Edition" is a French-English false friend word. "Edition" in English means "version" whereas "edition" in French means "editing". This commit updates user facing strings/documents that incorrectly use "edition" instead of "edit" or "editing". Attempts were made to clean up English around "edition" usage so please excuse any errors from lack of context knowledge. Code comments and names incorrectly using "edition" were NOT updated.
2020-03-13[REF] *: Adapt all modules to new control panelJulien Mougenot
Adaptation of the code throughout all modules to properly instantiate the newly refactored control panel and update it accordingly. Part of task 2196029 Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-02-21[FIX] barcode: input text is visibleRomeo Fragomeli
Before this commit, in mobile, the input to handle the input event of scanner was visible but with a negative z-index to be in the back of Odoo viewport. After this commit, in mobile, the input is transparent (opacity 0) and so is not visible anymore but it's still present. Steps to reproduce: * Go to app switcher (in mobile) * Scan a barcode with a hardware scanner BUG closes odoo/odoo#45975 X-original-commit: b2b1e68e541966ad832e03fbc230418d14c85616 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-10-18[REF] web,barcodes: simplify mobile device detectionRomeo Fragomeli
In this commit, we introduce "isMobileDevice". Do not confuse with isMobile. isMobile: A frequent use case is to have a different render in 'mobile' mode, meaning when the screen is small. This flag (boolean) is true when the size is XS/VSM/SM. It is also updated dynamically. isMobileDevice: Mobile device detection using userAgent. This flag doesn't depend on the size/resolution of the screen. It targets mobile devices which suggests that there is a virtual keyboard. Task ID: 2090202
2019-10-02[FIX] barcodes: Whitelist search inputsJairo Llopis
Before this patch, on mobile chrome, if user had focused in a `<input type=search>` element and writes something, the value never lands in the target input element and the on-screen keyboard hides. closes odoo/odoo#37843 X-original-commit: 12d4040b7196ae8f7a27d0081638413b52340019 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-23[FIX] *: hide technical field widgets in non-debug mode (Studio)Juhil Somaiya
*: - account - barcodes - calenndar - hr_timesheet - mail - mass_mailing - partner_autocomplete - web - website_slides This commit removes description of fields that should not be shown in non-debug mode Studio. Only field widgets whose own description is set are displayed in non-debug mode Studio in "Widget" of sidebar. In other words, even if any ancestor has a description but not the current widget, it won't be displayed in the sidebar in non-debug mode. Task-Id 2056992 closes odoo/odoo#35902 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-04-24[IMP] web, *: add a description to generic widgetsJuhil Somaiya
A `description` key has been added on AbstractField and all generic field widgets ; it is used to display a more user friendly name (both in the webclient and in Studio). Non-generic field widgets have an empty string as description. Related task 1918327 closes odoo/odoo#30131 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com> Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-03-25[MERGE] forward port branch saas-12.2 up to 230ad8c381eChristophe Simonis
closes odoo/odoo#32088 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-18[MERGE] forward port branch saas-11.3 up to 4e39328a76aChristophe Simonis
2019-03-18[FIX] barcodes: let focus in number, password, tel, phone inputsAdrien Dieudonne
Before this commit, users wasn't able to input values in some input elements like password, email and phone in mobile. Steps to reproduce: - Go to user - Select Preferences - Select Change password - Try to input something => The focus was lost and the keyboard disappeared In fact, a hidden input always have the focus when no other fields need it. This input is used to intercept a value from a barcode scanner. So now, we added some input types to avoid to set the focus on the barcode input. The barcode input is now always defined (even if not used in desktop) to be able to mock a Chrome mobile environment in a test. opw-1936712 opw-1948266 closes odoo/odoo#31841 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-03-13Revert "[FIX] barcodes: let focus in number, password, tel, phone inputs"Adrien Dieudonne
This reverts commit 1cdf2bdaf6fb8de398384b04287e564bfcd063ec. $(':focus') seems not working depending on browser version but we don't know yet exactly why. opw-1948266 closes odoo/odoo#31807 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-03-06[REF] barcodes: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-11[FIX] barcodes: let focus in number, password, tel, phone inputsAdrien Dieudonne
Before this commit, users wasn't able to input values in some input elements like password, email and phone in mobile. Steps to reproduce: - Go to user - Select Preferences - Select Change password - Try to input something => The focus was lost and the keyboard disappeared In fact, a hidden input always have the focus when no other fields need it. This input is used to intercept a value from a barcode scanner. So now, we added some input types to avoid to set the focus on the barcode input. It's quite difficult to test this feature because we aren't allow to simultate a keyboard to write in a input field. See https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent Plus, we don't have the focus in mobile except if we have the cursor inside the window. So, we can't test focused elements or input values. opw-1936712 opw-1948266 closes odoo/odoo#31566 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-01-09[FIX] barcodes: JS documenter fails to infer BarcodeEventsXavier Morel
As a result, parsing the JS fails and so does the doc compilation. Fixes odoo/odoo#29197 Fixes odoo/odoo#29961 closes odoo/odoo#30057
2018-12-07[FIX] barcodes: allow special keys input on firefoxlen-odoo
Install stock_barcode. It adds a barcode to the product quantity of the inventory adjustment view. On firefox special characters are ignored (CTRL, BACKSPACE, Fn...) closes odoo/odoo#29245
2018-09-11[FIX] barcodes: don't listen to barcode in input numberSimon Lejeune
related to rev 74fcd3ac3b0445c5fc0d9239900a9a41bfd04de8
2018-08-09[MERGE] forward port branch saas-11.3 up to af35aea6b0dChristophe Simonis
2018-08-08[MERGE] forward port branch saas-15 up to e7ccf38c48bChristophe Simonis
2018-08-08[FIX] barcodes: ok PageUp/Down/Home/End in firefoxNicolas Lempereur
Same reason as 8d948d92. In firefox if barcode is installed, for example on a form view the keys to navigate the possible scrolling PageUp/PageDown/Home/End don't work at all. This is caused by the interface barcode catching and differences of the key event handling between firefox and other browser. So in this change, we add these keys so they are not catched by barcode. note: aso backport 5bc29744c so the code is the same between 10 and 11. related to opw-706352 closes #26219
2018-06-28[MERGE] forward port branch saas-11.3 up to 3cdcbce93cbChristophe Simonis
2018-06-21[FIX] barcodes: nomenclatureNicolas Martinelli
Loads the barcode nomenclature only if one has been is defined. Indeed, from commit 80e89c7a11d16fa, the POS config unset the `barcode_nomenclature_id` field if the barcode support is not activated. opw-1859928
2018-06-20[FIX] barcodes: barcode inputSimon Lejeune
If the barcode input is hidden, it isn't possible to focus it and thus it isn't possible to actually use it. related to rev b4a83389591a88c16578c925c41372b838063fa4
2018-07-24[FIX] barcodes: barcodes working in button in dropdownJulien Machiels
On mobile, some barcodes didn't trigger in the picking screens, notably O-BTN.validate. This is due to the use of parent() to check if the button is in a dropdown, as parent() only checks one DOM-level upwards. The button being inside a <ul><li>, we need to check more levels than one to pass the condition and trigger the button press. By changing parent() to parents(), the entire chain will be checked, not just one level, and the button press is correctly triggered. opw-1860964 closes #25941
2018-06-11[FIX] barcodes: hide barcode inputAdrien Dieudonne
2018-06-11[REF] barcodes: form view: better error messagesSimon Lejeune
2018-06-11[REF] barcodes: pager: warn if a pager isn't presentMOENS Alexandre
If a barcode triggering an action on the pager was scanned while a pager wasn't present in the page (see the workorder tablet view), a traceback happened. We display a warning instead. Task: 1831245
2018-06-11[REF] barcodes: form view: multiples button for a single triggerMOENS Alexandre
This commit allows multiple button to share the same `barcode_trigger` attribute. Note that it only makes sense if a single button is displayed at a time. Task: 1831245
2018-05-30[FIX] barcodes: avoid virtual keyboard to show up while scanning barcodeAdrien Dieudonne
(1) Before this commit, the input barcode was removed from the dom after each scan but now we want to keep it focused to avoid to automatically open the virtual keyboard in mobile. This behavior will be useful in enterprise only. Another commit will follow in this repository. As the input is not removed anymore, we had to disable autocomplete to hide previous entries as suggestions. (2) We also add z-index property to avoid to click on the hidden input located in the middle of the page.
2018-04-30[FIX] barcodes: Android Odoo app webview not detected as chromeAdrien Dieudonne
Before this commit, it wasn't possible to use a barcode scanner with the Odoo mobile app. However it works fine for mobile Chrome browsers. We now know that 'keypress' event doesn't work as expected in Chrome for mobile. See @3a74afd21 It's why 'keydown' detection has been implemented. We also want to use this detection in our Android app. Unfortunately, 'window.chrome' doesn't seem to exist anymore in the Android webview. In this commit, we change the way Chrome is detected.
2018-04-30[FIX] barcodes: keep vertical position while scanningAdrien Dieudonne
Before this commit, you were automatically redirected to the top of the page when you scanned a product. It was, therefore, difficult to find the product that had just been scanned and to check its quantity. Because of @3a74afd21 we need to put the focus in an invisible input at the top of the page. This input is now always vertically centered in the middle of the page.
2018-04-18[FIX] barcode: do not trigger barcode on pending viewsArnold Moyaux
The check on the event target and the barcode target is done outside the check on barcode found. That result in a warning for each modal/form view that is pending. This commit do the check before doing any operations in order to directly stop if the event target is not similiar to listening barcode target
2018-04-18[FIX] barcode: use the same process for quantity listenerArnold Moyaux
The barcode scanner and the quantity listener do not use the same proccess although they act for the same operation. (For example the quantity listener trigger onchange server side while the barcode scanner not if 'notifychange' key on the active_barcode is set to False) Since quantity listener is based on candidate we could directly call the _barcodeSelectedCandidate method in order to have a common behavior and code.
2018-03-20[FIX] barcodes: barcode scanning on Chrome mobileAdrien Dieudonne
Before this commit, the barcode value wasn't triggered on some Android devices with Google Chrome and using the Odoo app. In fact, the keypress event may not trigger with some devices. This is probably due to the fact that this event is marked as 'Legacy'. See: https://www.w3.org/TR/uievents/#legacy-keyboardevent-event-types To fix this, we can use 'keydown' event but we have to handle an other issue: there is no way to know which key is typed. The auto-suggest feature on Android invalidate all the following properties: Keycode, charCode, key, which, keyIdentifier, code. This is a well-known issue: https://bugs.chromium.org/p/chromium/issues/detail?id=118639 For more infos, please read this blog: https://www.outsystems.com/blog/javascript-events-unmasked-how-to-create-input-mask-for-mobile.html As a work around, we create a temporary input field that stores the barcode value. The focus is set on this input when a keydown is detected. Note that when an input has the focus, the android virtual keyboard will be opened. We can't avoid this behavior. The only thing we can do is to automatically close it after 800 ms. See: https://bugs.chromium.org/p/chromium/issues/detail?id=662386 As this fix is specific for Chrome only, it's not possible to test it easily. Some tests will be added in master.
2018-03-20[FIX] barcodes: skip undefined keys in barcode valueAdrien Dieudonne
This fixes an issue occurring with Firefox. Some events was buffered with an undefined value and it wasn't possible to build the barcode value from these events. See 'handle_buffered_keys' function. So now, we simply skip this kind of event. We consider this as 'special keys'.
2018-03-07[FIX] barcodes: Do not trigger useless onchange server side.Arnold Moyaux
This commit improve perf by not trigger onchange server side on one2many field if the js could find a candidate. opw-785425
2018-03-07[FIX] barcode: set quantity with key pressArnold Moyaux
Allow the user to set the quantity with barcode scanning. This functionality was present in v9 but didn't work in v11. The code in order to make it work was already present in _quantityListener however it makes a check on setQuantityWithKeypress key on the obejct activeBarcode. Howver the key was never set during the activeBarcode event. This commit set the key on the activeBarcode if passed in the event data. It also allow to trigger a barcode if the user is inside a modal.
2018-02-01[MERGE] forward port branch saas-16 up to 920aa6174c9Christophe Simonis
2018-02-01[MERGE] forward port branch saas-15 up to e0422bfd6c5Christophe Simonis
2018-01-31[FIX] barcodes: delay between keysNicolas Martinelli
In order to detect if a barcode scanner is being used, we detect the delay between keypresses. The value is hardcoded to 55 ms. However, in the case of a bluetooth scanner, this delay is often not enough, resulting in an incorrect capture of the barcode. We add the config parameter `barcode.max_time_between_keys_in_ms` which allows the user to fine tune this delay for his hardware. opw-806398
2017-11-28[FIX] barcodes: manage several barcode widgetsSimon Lejeune
related to rev 0d19ee989d1d890860adaf360de204eb543136a5 It was broken following the refactoring done in saas16, resulting in barcodes being handled on all the displayed forms and it was problematic in the case of a form dialog openned over a "fullscreen" form view. This was particularily problematic for the scrap dialog in the stock_barcode module.
2017-09-29[IMP] barcodes: corrected barcode commands of CMD-PREV and CMD-NEXT as well ↵Vandan Shah
as changed qunit test case accordingly
2017-09-27[FIX] stock, barcodes: allow force detailed view of picking and rename ↵Pierre Masereel
barcode 'CANCEL' to 'DISCARD'
2017-09-18[FIX] *: fix a bunch of incorrectly documented docstringXavier Morel
Fix a bunch of ill-documented/incomplete/incorrect method docs Without this, the automatic doc generation does not work.
2017-08-31[MERGE] forward port branch saas-17 up to fe77df3ba48Christophe Simonis
2017-08-25[FIX] barcodes: barcode handlers should return a deferredAaron Bohy
This was the case about 15minutes ago. But before pushing we decided to change the Barcode override of FormController to directly use handlers of the FormController when it could (e.g. to handle 'Edit', 'Discard' actions). This wasn't a good idea as those handlers don't return anything, and the barcode mechanism requires its handlers to return a deferred. So basically, it crashed when such a barcode was scanned. Having a test suite is nice, but you should not forget to relaunch it before pushing...
2017-08-25[FIX] web,barcodes: pager: FIRST and LAST actionsAaron Bohy
The barcode mechanism is supposed to handle commands PAGER-FIRST (go to first record referenced in the pager) and PAGER-LAST (go to last record). Before this rev., it wasn't the case. We needed to add an option 'notifyChange' to the updateState function of the pager, to ensure that the form is correctly reloaded when the pager cursor is manually set (by the barcode handler) on the first or last element.
2017-08-25[FIX] barcodes: generate correct update commandAaron Bohy
The barcode mechanism is optimized to (in certain conditions), directly increment the quantity of a numerical field inside an x2many, without performing any RPC, and then re-rendering the x2many to display the new value. Before this rev., it seemed to work fine, but when the view was saved, those changes of quantity were lost. This was because the changes weren't correctly notified to the model (the quantity field being inside an x2many, the correct update command for the x2many should be generated).
2017-08-25[FIX] barcodes: barcode_handler widget should be genericAaron Bohy
When a barcode field with widget="barcode_handler" is in a form view, an onchange RPC should be done each time a barcode is scanned. Before this rev., it worked by chance because the views using it don't define a 'pack_operation_product_ids' field. Anyway, this widget is meant to be generic, so it shouldn't hardcode a fieldname.