Commit Graph
25 Commits
Author SHA1 Message Date
Rémy Voet (ryv) bdc2241260 [IMP] barcodes: Avoid extra request
Avoids to do a RPC if the nomenclature is direclty passed through the
arguments while the barcode parser is initiate.

Also, makes the `load` method always returns a promise.

closes odoo/odoo#72685

Related: odoo/upgrade#2713
Related: odoo/enterprise#19226
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-08-24 15:23:51 +00:00
Rémy Voet (ryv) 1c0dec6d58 [ADD] barcodes_gs1_nomenclature
In order to integrate and use GS1 nomenclature into `stock_barcode`,
adds a new module with GS1 nomenclature and rules, and overrides parsing
methods.

task-1968113

closes odoo/odoo#65858

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Co-authored-by: ryv-odoo<ryv@odoo.com>
2021-02-26 08:21:08 +00:00
Rémy Voet (ryv) a09e370ec5 [REF] barcodes: refactor check digit computation
To prepare gs1-128 feature, refactors the check digit computation.
Also, does some cleanings:
  - Removes unusused check_ean method;
  - Converts comments into docstrings;
  - Makes needed changes to avoid linter errors (PEP 8).

task-1968113

Co-authored-by: ryv-odoo<ryv@odoo.com>
2021-02-26 08:21:08 +00:00
0ab6a62997 [REF] barcodes: adapt code after jQuery update
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-06 20:07:17 +01:00
Nicolas Martinelli 1fe119da3b [FIX] barcodes: nomenclature
Loads the barcode nomenclature only if one has been is defined. Indeed,
from commit 80e89c7a11, the POS config unset the
`barcode_nomenclature_id` field if the barcode support is not activated.

opw-1859928
2018-06-21 10:40:59 +02:00
Christophe Simonis 34b432d528 [MERGE] forward port branch saas-15 up to 4d79a1ff58 2017-06-26 19:19:39 +02:00
Lucas Perais (lpe) bf5312428f [FIX] barcodes: comply the ean parser with reportlab.graphics.barcode
Before this commit, the JS parser would add 0 after the input, then add the ean key.
Whereas reportlab.graphics.barcode fills the input with 0's on the left, then add the key

http://pydoc.net/Python/reportlab/2.5/reportlab.graphics.barcode.eanbc/
At: Ean13BarcodeWidget.__init__()

This commit makes the ean parser coherent with the lib the python uses
2017-06-16 08:41:58 +02:00
Géry Debongnie 2106e3dd2e [REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly.  This commit introduces the new rpc
system, which replace the previous new one.  We now simply have a
method, this._rpc, which takes a dictionary of parameters.  The idea is
that depending on the parameters, it is able to add correct default
value when necessary.

For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
2017-04-11 19:44:38 +02:00
Géry Debongnie 86a87aa8b0 [REF] *: use _rpc method for all rpcs
The _rpc method is now the preferred method to do a rpc, so we need to
update all calls.
2017-04-11 19:44:38 +02:00
Géry Debongnie e574027056 [REF] web,*: remove 'web.model' and 'web.dataModel
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
2017-04-11 19:44:38 +02:00
Christophe Simonis 2cf91d16a5 [MERGE] forward port of branch saas-6 up to 63e92cb 2015-07-22 16:17:54 +02:00
Christophe Matthieu 500c33b184 [IMP] web: split model.js into model.js and data_model.js. Web js modules must call web.DataModel. 2015-07-10 16:32:35 +02:00
Joren Van Onder 80da43ebb8 [FIX] barcode_parser: don't match end of line
Causes issues with the card reader device.
2015-07-02 16:42:35 +02:00
Frédéric van der Essen 50c147514e [FIX] barcodes: correctly recompute the checksum of the product barcode when guessing it from a value encoding barcode 2015-06-29 15:43:15 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
Frédéric van der Essen 00236aafcc [FIX] point_of_sale: barcode patterns must match barcode as prefix, (and not anywhere in barcode) 2015-05-05 14:04:39 +02:00
Géry Debongnie 4fdf74fe21 [IMP] web+addons: improvement to module system
The module system needs to know the dependencies of a given module
before executing the function.  This is why the dependencies were
defined once in an array, and then were described one more times in the
call to require.

But a trick can simplify this: the boot function can parse the string
representation of the module and extract the calls to require from it.
It is more work for the processor, but it leads to simpler module
definitions.
2015-03-18 09:23:37 +01:00
Géry Debongnie 0dcc559cdd [REF] barcodes: update to the new module system 2015-03-18 09:01:51 +01:00
Frédéric van der Essen 3c5f62413e [FIX] barcodes: typo in function name 2015-01-28 17:01:27 +01:00
Frédéric van der Essen 59b0907d2e [IMP] barcodes, point_of_sale : add support for UPC-A barcodes
- Added support for UPC-A Barcodes
 - Add a way to automatically convert UPC-A to and from EAN13. This
   is usefull if you wish to standardise your product barcode encoding
   in one standard but have a mix of the two in your merchandise.
 - Various bugfixes.
2015-01-13 16:19:39 +01:00
Aaron Bohy dbcc93154f [FIX] barcodes: parse_barcode functions in PY and JS commented 2014-11-26 12:11:55 +01:00
Aaron Bohy b671824048 [FIX] barcodes, stock, point_of_sale: parse_barcode function uses regex, pattern and barcodes may now contain special characters \ { and ., special character * replaced by . 2014-11-26 12:11:51 +01:00
Aaron Bohy aae9dfe4e7 [FIX] barcodes: prepend a zero to ean13 barcodes scanned before looking for a match 2014-11-26 12:06:23 +01:00
Aaron Bohy 84c743dd40 [FIX] barcodes,point_of_sale,stock,base: minor changes from code review 2014-11-26 12:06:21 +01:00
Aaron Bohy 956faa62f7 [FIX] barcodes, point_of_sale: JS functions for parsing barcode moved to module barcodes, BarcodeParser 2014-11-26 12:06:20 +01:00