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

Hello all,

In my custom module, I'm rewriting the create_from_ui method of pos.order class.

I would want to reuse the same variables already defined in the original create_from_ui method.


Here is my code in my custom module :

def create_from_ui(self, cr, uid, orders, context=None):
        _logger.error("create_from_ui NEW BEGIN")
        res =   super(pos_order, self).create_from_ui(cr, uid, orders, context=context)           
        
        #I want to use SOME VARIABLES OF THE ORIGINAL create_from_ui METHOD HERE...
        _logger.error("create_from_ui END BEGIN")
        return res


Do you know how to manage it?


อวตาร
ละทิ้ง
ผู้เขียน

So, like I thought, sometimes we have to rewrite a part of the code of the original method in the new one. To rebuild some variables.

คำตอบที่ดีที่สุด

Only those returned via 'res'.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มิ.ย. 15
9691
1
ส.ค. 23
3418
Python "super" - function does not work แก้ไขแล้ว
2
ธ.ค. 22
12693
2
ต.ค. 21
3998
0
ก.ย. 21
4184