跳至内容
菜单
此问题已终结
1 回复
3756 查看

 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
9月 21
2818
1
2月 21
2456
1
6月 23
4213
1
2月 22
5375
1
11月 20
2267