Skip to Content
Menu
This question has been flagged
1 Atsakyti
4134 Rodiniai

 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


Portretas
Atmesti
Best Answer
from odoo import api

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

api.split_context = new_split_context                                             
Portretas
Atmesti
Autorius

Oh I forgot to assign that. Thanks rehan

Related Posts Replies Rodiniai Veikla
1
rugs. 21
3150
1
vas. 21
2859
1
birž. 23
4765
1
vas. 22
5960
1
lapkr. 20
2542