Commit Graph
23 Commits
Author SHA1 Message Date
Adrien Widart 186537b90a [IMP] barcodes: remove size constraint on pattern
The size constraint on the barcode pattern is an old one and is no more
required. Moreover, if someone wants to add new GS1 patterns, he might
need more than 32 characters.

Part-of: odoo/odoo#82883
2022-02-07 14:18:00 +00:00
Tiffany Chang (tic) 59e480439e [IMP] delivery, stock: print SSCC datamatrix for packages
When a package name is a valid SSCC number, we prefer to auto-print the
datamatrix to be used by shippers, which includes:
  - the SSCC number
  - the pack date (i.e. when it was put in pack)
  - the weight of the package (only when less or equal to 6 digits)

Pack date field was added to accomodate this and defaults to when
package is created (e.g. when buying packaged meat at the supermarket,
it's assumed the pack date is when the package of meat was created).

SSCC datamatrix will auto-print now in 3 package reports:
  - Package with contents
  - Package Barcode (PDF)
  - Package Barcode (ZPL)

Note if ability to create datamatrix appears to not work (only in PDF
versions) then standard 1D barcode will be used.

Part of Task: 2494740
Related ENT PR: odoo/enterprise#23323
Upgrade PR: odoo/upgrade#3202

Part-of: odoo/odoo#82389
2022-01-31 12:06:05 +00:00
Tiffany Chang (tic) e6282eb213 [IMP] product_expiry, stock: include product barcodes in package content
When a product's barcode is EAN compliant (i.e. EAN-8, EAN-13, GTIN-14})
and feature to create DataMatrix is fully installed then we would like
to print its GS1 datamatrix on the package content report.
Additionally, if the product is tracked, we would like to include its
SN/Lot if assigned one + any "use by"/"expiration date" to make the
overall usefulness of the report go up.

Part of Task: 2494740

Part-of: odoo/odoo#82389
2022-01-31 12:06:04 +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
svs-odooandryv-odoo d1abf31fb4 [MOV] barcodes: split barcodes.py
Separates `barcode.nomenclature` and `barcode.rule` in their own file.

task-1968113

Co-authored-by: ryv-odoo<ryv@odoo.com>
2021-02-26 08:21:08 +00:00
Victor Feyens b932ea75fe [FIX] barcodes: wrong translation specification
String formatting was wrong because the mapping wasn't specified.

Finetuning of
https://github.com/odoo/odoo/commit/8a8d482b43394f834bc0ddf3cb0c0c62f11b90b1
2020-07-22 11:01:28 +00:00
Victor Feyens 8a8d482b43 [IMP] *: do not split translations to insert values
* Less translations
* Translations more precise and adapted to the context
2020-07-06 10:29:39 +00:00
Damien Bouvy d2b02cab29 [FIX] web,(various): don't pollute session_info for portal users
The `session_info` dictionnary is used to bootstrap some JS code client
side (usually in the backend). It includes relevant information, such
as some parameters key for the OdooBot onboarding, the Enterprise
subscription expiration alert, etc. to avoid triggering a lot of RPC
calls upon webclient start.

`session_info` is also called by the remote authentication mechanism
located at `/web/session/authenticate`, which can be used by external
mechanism to obtain a valid session remotely.

Revision odoo/odoo@8a28cc2 introduced the concept of cache keys for
some oft-requested data (such as menus, translations and dynamic qweb
templates) to avoid requesting them on each webclient start, since they
tend not to change often. Unfortunately, it introduced a read on the
ir.ui.menu model that raised an `AccessError` if the authenticating user
was not a member of the `base.group_user` group ('Internal' user type).

While fixing that issue, it became apparent that `session_info`
returns a whole lot of information through this remote connection route
which is entirely unnecessary if not used in the context of a webclient
start, such a currencies, the state of the enterprise subscription, etc.

This commit fixes the access right issue by removing this non-relevant
information from the returned dict (including cache keys) if the user
is not an internal one.

closes odoo/odoo#40770

X-original-commit: 6e99ac2c6cd5ca9af87b4fc7a3a1394359e30b02
Related: odoo/enterprise#6860
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-12-02 09:21:32 +00:00
Adrian Torres 9e71d57d11 [REM] *: remove calls to api.one and adapt code
Adapt all code that was using `api.one` to recordset-style method and
remove any and all calls to `api.one` in preparation for its removal.
2019-07-05 09:04:45 +00:00
Nimesh Jethva 2c1549cc59 [IMP]tools, technial modules: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:15 +02:00
Christophe Simonis a12c4d284c [MERGE] forward port branch saas-11.4 up to a1b384d66b 2018-09-18 11:42:52 +02:00
Martin Trigaux a47f7ee0e4 [FIX] product: do not translate at code import
Defined as this, the label of the selection field were translated during code
import, when building the python model, not when a user access the field values
as it should (and is already the case thanks to the ORM).

Trying to translate a string when no user-context is available is not only
useless but may cause bug on services with multiple databases (e.g. a SaaS).

In a multi-worker environment, when the code is imported, the _ method will use
multiple scenarios to detect the language and get a cursor.

As we have no available cursor in the frame (method _get_cr from GettextAlias),
the fallback is made on the cursor of the request.
In a multi-worker environment, this could be a cursor linked to a database in
another language than English.
In such scenario, the selections would be translated in the language of the
other database instead of displaying it in English

opw-1881956
2018-09-14 11:20:38 +02:00
William Henrotin 95a9572da3 [REF] barcodes, stock, point_of_sale: one nomenclature per company
This commit adds a many2one between barcode.nomenclature and res.company
and removes Many2one pointing toward a nomenclature record.

This aims to improve the usability and allows using nomenclature in
inventory adjustment where a `nomenclature_id` field was set.
2018-09-10 13:33:42 +02:00
Prakash Prajapati 86d10380a1 [REF] barcodes, delivery, mrp, product, stock: Changing labels
Task: 1879617
2018-08-30 17:24:24 +02:00
Christophe Simonis 920aa6174c [MERGE] forward port branch saas-15 up to e0422bfd6c 2018-02-01 16:40:13 +01:00
Nicolas Martinelli 513fad42a0 [FIX] barcodes: delay between keys
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
2018-01-31 13:47:17 +01:00
Olivier Dony ba15df47cb [MERGE] Forward-port saas-15 up to 17b847c0f6 2017-06-01 01:10:29 +02:00
Laurent Mignon (ACSONE) a1db50e7c8 [FIX] barcodes: fixes ean8 checksum computation
According to the docstring, the given ean is a string but was summed.

Closes #16813
2017-05-30 16:51:59 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Tanguy Charlier a1a8d6d44f [MIG] barcodes: Simplify selection fields overrides 2016-06-07 17:43:35 +02:00
Ranjit Pillai 93fc313065 [MIG] barcodes: Migrated to new api 2016-06-07 17:43:35 +02:00
Ranjit Pillai cb313ac19f [MOV] barcodes: Reorganised file structure. 2016-06-07 17:43:35 +02:00
Arthur Maniet 2df4060c77 [ADD] barcodes: onchange-like mechanism to react to scans in form view
For a model to use it, it must :
- Inherit barcodes.barcode_events_mixin and override on_barcode_scanned(self, barcode)
- Add <field name=barcode_scanned widget=barcode_handler/> to each form view that
  should listen to barcode events and trigger on_barcode_scanned.

The method on_barcode_scanned works just like an onchange.
2015-09-01 13:25:52 +02:00