跳至内容
菜单
此问题已终结
2 回复
4704 查看


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.

形象
丢弃
相关帖文 回复 查看 活动
3
3月 16
3990
0
9月 18
3191
2
3月 15
7149
0
3月 25
1348
0
1月 25
3435