Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odpovědi
5627 Zobrazení

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
Zrušit
Nejlepší odpověď

Example:

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


Avatar
Zrušit
Autor

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

Nejlepší odpověď

HI,

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

Avatar
Zrušit
Autor Nejlepší odpověď

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

Thanks.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
7
lis 23
8771
1
kvě 17
3153
2
bře 19
11000
19
kvě 24
96581
3
zář 16
3369