تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
5649 أدوات العرض

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يونيو 15
9560
1
أغسطس 23
3279
2
ديسمبر 22
12541
2
أكتوبر 21
3811
0
سبتمبر 21
4077