Odoo Help

Welcome!

This community 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.

0

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

By
Pierre Lamarche
on 4/23/13, 6:53 PM 1,209 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 !

Pierre

1

Gustavo

--Gustavo--
950
| 2 1 4
Buenos Aires, Argentina
--Gustavo--

Python developer, big fan of sailing

Gustavo
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.

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

Hi,

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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