Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
8408 Vistas

That is when creating new customer / supplier, and set to be a company, how to check the partner name to be unique.

When it is not a company, the customer or supplier, i.e. contacts can have same name.

More generally, how to set one column name to be unique while another or other columns have a specified value.

Avatar
Descartar

Somes company can have the same name, but it's off topic.

Have you tried to inherit the field name to transform him into a fields.function(_get_name_is_unique, fnct_inv=_save_name, type='char', store = True, string = 'Name'), The important part is the fnct_inv=_save_name wich allows you to write a name.

Autor

Don know how. Is it possible to use _sql_constraints?

Maybe, i don't use often _sql_constraints. If you want to use this, try that : http:// help.openerp.com/question/22620/how-can-i-mark-a-field-unique-in-a-custom-model/

Autor Mejor respuesta

Finally a solution i made:

https://github.com/youring/company_unique

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
oct 24
12376
0
oct 22
2099
6
abr 25
17336
1
abr 15
4410
0
abr 15
7152