Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
5649 มุมมอง

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
8782
1
พ.ค. 17
3170
2
มี.ค. 19
11021
19
พ.ค. 24
96651
[9.0] Add a field to a view แก้ไขแล้ว
3
ก.ย. 16
3420