تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
8424 أدوات العرض

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.

الصورة الرمزية
إهمال

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.

الكاتب

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/

الكاتب أفضل إجابة

Finally a solution i made:

https://github.com/youring/company_unique

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
creation of company تم الحل
1
أكتوبر 24
12418
0
أكتوبر 22
2164
6
أبريل 25
17398
1
أبريل 15
4450
0
أبريل 15
7178