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

I need to fix a bug in a community module. However, calling SUPER will always cause the error to be thrown.

Using osv I can do something like...

osv.osv.write(self, cr, uid, ids, vals, context=context)

This will ignore any other changes to write().


How can we do this using the new API? It's a big method and I don't feel like rewriting it using the old API...

形象
丢弃
最佳答案

Example:

@api.multi    
def unlink(self):
        ...
        return models.Model.unlink(self)


形象
丢弃
编写者

I had already tried that but it didn't work. Here's why: one needs to add the "self"...

xpto = models.Model.write(self,vals)

Just as in my example

最佳答案

HI,

please try models.Model.write(self, vals) if you are using any decorators like @api.multi

形象
丢弃
编写者 最佳答案

I'm not contradicting you, I'm emphasizing why it wasn't working.

Thanks.

形象
丢弃
相关帖文 回复 查看 活动
7
11月 23
8711
1
5月 17
3123
2
3月 19
10962
19
5月 24
96477
3
9月 16
3308