コンテンツへスキップ
メニュー
この質問にフラグが付けられました
5 返信
5576 ビュー

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
8746
1
5月 17
3133
2
3月 19
10970
19
5月 24
96504
3
9月 16
3328