EAN code validation fails

Bug #606325 reported by Gerhard du Toit
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Wishlist
OpenERP R&D Addons Team 2

Bug Description

Valid 14 digit outer case codes that fails the ean validation check all the time.

Tried with product-gtin module as well but still fails
Here are some examples.

16009657970026
16001009005806

running version 5.0.12

Tags: ean gtin

Related branches

Revision history for this message
Ferdinand (office-chricar) wrote :

please try with attached chricar_product_gtin

IMHO it's a bug in the server as the constraint in product.py must be disabled manually , after doing so the constraint check works.

product/product.py
#_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])]

you should get an different message entering code like
"Error: Invalid Bar Code Number"

Revision history for this message
Ferdinand (office-chricar) wrote :

please can someone with more rights change the titel of this bug
"_constraints are not (always ?) replaced ..."

Revision history for this message
Gerhard du Toit (gdutoit) wrote :

Why is this code not simply taken into the main product/product.py.

This is so universal, I cannot believe that there are many people who can get along with ean-13 only.

Revision history for this message
Ferdinand (office-chricar) wrote :

very good question ;-)
IIRC the default installation takes 12 digits and calculates the checkdigit (13) - so it was not even suitable for UPC..

summary: - ean validation fails
+ EAN code validation fails
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Ferdinand,Gerhard,

      I have checked the scenario for EAN. And I agree with you guys that EAN should be in all varieties. So I have made few changes for that and have attached a solution for that. Would you please check it and notify us? Thanks a lot for pointing towards the issue. It will improve the functionality for products using different EANs.

Thanks.

Changed in openobject-addons:
assignee: nobody → Anup (Open ERP) (ach-openerp)
status: New → In Progress
Revision history for this message
Gerhard du Toit (gdutoit) wrote :

I tried the patch but it still fails. (applied to 5.0.12)
Here is an example of a valid ean code used on a daily basis.
16001009005806

Revision history for this message
Ferdinand (office-chricar) wrote :

@Anup
Using my module I can enter and save a product with all the number given here as an example - IMHO the formula given in my module is correct - do not have time to check if you implemented it completely

Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Gerhard,

   I have checked the ean14 example code and have made few modifications in the existing patch and made a refined solution. Would you please check it and notify us?

Thanks,

Revision history for this message
Ferdinand (office-chricar) wrote :

Hello!

I just discovered another instance of ean check here

product/product.py
class product_packaging(osv.osv):

as well as in res/parnter/partner.py

IMHO we should have only ONE check procedure which is called from the other modules

Revision history for this message
Ferdinand (office-chricar) wrote :

ean in class product_packaging
* is not checked for valid entry
* the content of ean is displayed in the field "Packaging" (because of _recname ='ean')

if the ean is empty - which is a valid and necessary option "False" is displayed - not useable.

IMHO we need a name_get which returns the ean or name (Description)

@Anup - can you do this ?

Changed in openobject-addons:
status: In Progress → Confirmed
importance: Undecided → Wishlist
assignee: Anup (OpenERP) (ach-openerp) → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Rohan Nayani(Open ERP) (ron-tinyerp) wrote :

Hello Gerhard,

I have Fixed for EAN8,EAN13 and EAN14 Code validation check below Branch

It has been fixed in lp:~openerp-dev/openobject-addons/ron-dev-addons2
Revision ID: <email address hidden>
Revision num: 5059.

and also Fix validation field "ean" in product_packaging on below Revision ID

It has been fixed in lp:~openerp-dev/openobject-addons/ron-dev-addons2
Revision ID: <email address hidden>
Revision num: 5060.

It will be available in trunk soon,

Changed in openobject-addons:
status: In Progress → Fix Released
Revision history for this message
Ferdinand (office-chricar) wrote :

I do not know if this ever arrived in trunk
I attach a module fixing the issue for v6

Revision history for this message
Ferdinand (office-chricar) wrote :

please see
extra-trunk/chricar_product_gtin

Revision history for this message
xrg (xrg) wrote : Re: [Bug 606325] Re: EAN code validation fails

On Sunday 09 January 2011, you wrote:
> please see
> extra-trunk/chricar_product_gtin
>
> ** Attachment removed: "chricar_product_gtin.tar"
>
> https://bugs.launchpad.net/openobject-addons/+bug/606325/+attachment/17875
> 62/+files/chricar_product_gtin.tar

For some reason, the tar file is not accessible. Can you please check again or
provide us a new path for that module?

I'm interested to see how you redefine the _constraints[] in that module.

Revision history for this message
Ferdinand (office-chricar) wrote :

Meanwhile I manage to save it to extra-trunk/chricar_product_gtin so I removed the tar to avoid duplicates

please see
 extra-trunk/chricar_product_gtin (comment 14)

please could you also check the complete construct

in product/product.py the check_ean is not part of product_product() any more
Question how to replace it?

Revision history for this message
Ferdinand (office-chricar) wrote :

BTW IMHO htis should be standard, beccause EAN 13 is used in Europe and UPC (12) is used in USA - hence many people will need this extension.

Revision history for this message
Ferdinand (office-chricar) wrote :

works now with V6

Revision history for this message
Julián Lozano (jlozano) wrote :

Hello everyone

I want to know, If I change the constraint in those two places, I can still reading a bar code example UPC-!2 but without validation?. I needed because all the products have UPC-A or UPC-E 8 digits.

Thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.