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

Hello all, 

I just want to override completely the create method of pos_session class in my custom module.

But because the original create method use return super(), I don't manage it. My new create method always return and use the old one because of the super.

I don't want to use the original create method anymore.

Here is a part of my override code :

class pos_session(osv.osv):
    _inherit = 'pos.session'
    def create(self, cr, uid, values, context=None):
     [...]
        
        res = super(pos_session, self).create(cr, uid, values, context=context) 
        return res


Thanks to help

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I think this line will do the job instead :

res = osv.osv.create(self, cr, uid, values, context=context)
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 22
3816
1
พ.ย. 15
6099
0
พ.ย. 15
13
How to override an overrided method แก้ไขแล้ว
3
ก.ย. 22
13643
5
มี.ค. 20
11571