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

I want to access database and get the name from a table to check if the name exist or not.

I know that I need to override the create function but I have no idea for what should I put inside the function

Also, i'd like to ask how to pop up en error message like the validate checking when the name is existed

الصورة الرمزية
إهمال
أفضل إجابة

you can use cursor(or cr) present in a method..

almost all ORM methods will have these paramaters: self, cr, uid

so one can use cr, which is nothing but cursor paramater used to deal with database...

Example: cr.execute("select * from res_partner")

And to do validation: you can set _sql_constraints in your object
 

Hint: use Ctrl + H to search in you the addons, if you are using EDI like eclipse/aptana studio

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
أبريل 24
1732
3
مايو 22
15184
1
ديسمبر 16
3023
1
مارس 15
12022
0
مارس 15
3286