Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
5 Antworten
5619 Ansichten

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
Verwerfen
Beste Antwort

Example:

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


Avatar
Verwerfen
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

Beste Antwort

HI,

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

Avatar
Verwerfen
Autor Beste Antwort

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

Thanks.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
7
Nov. 23
8770
1
Mai 17
3150
2
März 19
10998
19
Mai 24
96571
3
Sept. 16
3365