Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
5 Ответы
5564 Представления

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...

Аватар
Отменить
Лучший ответ

Example:

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


Аватар
Отменить
Автор

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

Лучший ответ

HI,

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

Аватар
Отменить
Автор Лучший ответ

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

Thanks.

Аватар
Отменить
Related Posts Ответы Просмотры Активность
7
нояб. 23
8722
1
мая 17
3124
2
мар. 19
10967
19
мая 24
96485
3
сент. 16
3318