Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odgovori
5572 Prikazi

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
Opusti
Best Answer

Example:

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


Avatar
Opusti
Avtor

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

Best Answer

HI,

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

Avatar
Opusti
Avtor Best Answer

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

Thanks.

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
7
nov. 23
8737
1
maj 17
3132
2
mar. 19
10968
19
maj 24
96495
3
sep. 16
3324