# How to add EAN13 in product form?

By
Remya
on 3/12/13, 6:18 AM 6,756 views

When i add 13 digit number in product form.

It shows error: Error occurred while validating th field(s) ean13: You provide an invalid "EAN13 barcode" reference. You may use the "Internal Reference" field instead

tvazac
On 3/12/13, 6:32 AM

Is it a valid EAN13 code? It has some requirements. Try for example: 5012345678900

when i click on the 'Set a custom EAN' button, i got the valid EAN number. What requirement?

Remya
on 3/12/13, 9:00 AM

@Remya It's described on wiki (EAN13). You can choose first 12 numbers. The 13th is computed. Let x be the sum of numbers on odd positions Let y be the sum of numbers on even positions Let z be x+(y*3) Let z' be z rounded up (73 to 80 for example) Then 13th number is z' - z

tvazac
on 3/12/13, 9:29 AM

I tried with this formula, but it throws error... My example is 5932530127130

Remya
on 3/13/13, 2:59 AM

You have wrong last digit. I show you with your example. So (5+3+5+0+2+1) = 16, (9+2+3+1+7)*3 = 75. Therefore we have 16 + 75 = 91. Then rounded(91) - 91 is 100 - 91 = 9. So your last digit should be 9 and then it's a valid EAN code

tvazac
on 3/13/13, 5:32 AM

ok. its just my mistake. I got last number 9, when i click the 'Set a custom EAN' button. Now cleared. And Thanks for your reply...

Remya
on 3/13/13, 6:11 AM

#### Parth Gajjar

--Parth Gajjar--

1554
| 3 3 5
--Parth Gajjar--
Parth Gajjar
On 3/12/13, 6:35 AM

You can not use any number as EAN13.

EAN13 is field for barcode. This number validate after some checksum on number.And there are some rules for generating such numbers.

Example for :5901234123457

This code will work because it is valid EAN13 code.

Then also you need set your custom barcode. Install point_of_sell module and this will enable Button 'Set a Custom EAN' below this EAN13 field and with help of this button you can add your custom EAN13 no. But this is not recommended.

Hope this will help.

Remya
on 3/12/13, 7:30 AM

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

### Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

1 follower(s)

### Stats

 Asked: 3/12/13, 6:18 AM Seen: 6756 times Last updated: 9/26/17, 12:18 AM