Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4055 Widoki

 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


Awatar
Odrzuć
Najlepsza odpowiedź
from odoo import api

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

api.split_context = new_split_context                                             
Awatar
Odrzuć
Autor

Oh I forgot to assign that. Thanks rehan

Powiązane posty Odpowiedzi Widoki Czynność
1
wrz 21
3076
1
lut 21
2781
1
cze 23
4676
1
lut 22
5864
1
lis 20
2495