This question has been flagged
2 Replies
3810 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

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

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 !

You have to extend it with multicompanies features.

Best Answer

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

Avatar
Discard