Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
5 Replies
5554 Tampilan

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...

Avatar
Buang
Jawaban Terbai

Example:

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


Avatar
Buang
Penulis

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

Jawaban Terbai

HI,

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

Avatar
Buang
Penulis Jawaban Terbai

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

Thanks.

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
7
Nov 23
8711
1
Mei 17
3123
2
Mar 19
10966
19
Mei 24
96479
3
Sep 16
3310