Odoo Help


Does anybody know a way to forbid the creation of a new product with the name of an already existing product ?

Pierre Lamarche
on 4/23/13, 6:53 PM 1,667 views

The aim is to avoid to have two products with the same name...

To go further, in a multicompany environment, this restriction will have to be PER COMPANY : - in Company A, I can't have two products with the same name but - in Company B, I can have the same product than in company A

Thanks in advance for your help !




| 2 2 4
Buenos Aires, Argentina

Python developer, big fan of sailing

On 4/23/13, 8:20 PM

A simple way is to create a module that extends the product.product object and adds the unique constraint. Check http://v6apps.openerp.com/addon/5609 for a module that does that

Thanks, I already tested this module and the forbid works for the first part of my scenario (within company A, I can't create a new product with the same code or name). But in my scenario, when I work for Company B (remember, I am in a multicompany environment), I do have to be able to create the same product than in company A. The constraint of this module is for all companies of an instance unfortunately. Thanks for your help !

Savoir-Faire Linux, Pierre Lamarche
on 4/24/13, 12:38 PM

You have to extend it with multicompanies features.

Savoir-faire Linux, Bruno JOLIVEAU
on 6/23/15, 10:00 AM
Dharmesh Rathod
On 4/24/13, 2:01 AM


You have to implement your own constraint. Use _constraint instead of _sql_constraint.

_sql_constraint will make unique constraint for each records and apply in database.

Email : info@acespritech.com
Skype : acespritech

About This Community

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.

Test it now

Question tools

0 follower(s)


Asked: 4/23/13, 6:53 PM
Seen: 1667 times
Last updated: 3/16/15, 8:10 AM