Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
5 Respostas
5694 Visualizações

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
Cancelar
Melhor resposta

Example:

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


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

Melhor resposta

HI,

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

Avatar
Cancelar
Autor Melhor resposta

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

Thanks.

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
7
nov. 23
8851
1
mai. 17
3219
2
mar. 19
11068
19
mai. 24
96839
3
set. 16
3482