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

 I have to try to override one method in my module. The base method is ​split_context it is in the api.py. I have tried with the override from odoo import api and then override all the method. 

            def split_context(method, args, kwargs):
                 pos = len(getargspec(method).args) - 1
                if pos < len(args):
                     return args[pos], args[:pos], kwargs
                else:
                      return kwargs.pop('context', None), args, kwargs          

but the method is not called in my custom module


الصورة الرمزية
إهمال
أفضل إجابة
from odoo import api

def new_split_context(method, args, kwargs):
    \\ copy the original
    \\ add your custom

api.split_context = new_split_context                                             
الصورة الرمزية
إهمال
الكاتب

Oh I forgot to assign that. Thanks rehan

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
سبتمبر 21
3151
1
فبراير 21
2859
1
يونيو 23
4765
1
فبراير 22
5961
1
نوفمبر 20
2542