Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
5 Risposte
5571 Visualizzazioni

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
Abbandona
Risposta migliore

Example:

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


Avatar
Abbandona
Autore

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

Risposta migliore

HI,

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

Avatar
Abbandona
Autore Risposta migliore

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

Thanks.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
7
nov 23
8736
1
mag 17
3132
2
mar 19
10968
19
mag 24
96494
3
set 16
3323