Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4672 มุมมอง


maybe someone can explain me meaning of this error:

File "/opt/odoo/openerp/api.py", line 715, in __new__

self.registry = RegistryManager.get(cr.dbname)

AttributeError: 'crm.lead' object has no attribute 'dbname'


from my module i call other function from inherited class

my code

class crm_lead(models.Model):

_inherit = 'crm.lead'

def custom_create_contact(self, cr, uid, ids, context=None):

res = self.handle_partner_assignation(self, cr, uid, ids)

return res


I am calling this function with button from lead form.


Thanks!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด


res = self.handle_partner_assignation(cr, uid, ids)

Error is because, self.dbname doesn't exists !

self is the object which call the method! Don't need to pass the parameter again !

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thank you Jérémy.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
มี.ค. 16
3963
0
ก.ย. 18
3179
How to translate the sign in button ? แก้ไขแล้ว
2
มี.ค. 15
7128
0
มี.ค. 25
1336
0
ม.ค. 25
3429