Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
4080 Ansichten

 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


Avatar
Verwerfen
Beste Antwort
from odoo import api

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

api.split_context = new_split_context                                             
Avatar
Verwerfen
Autor

Oh I forgot to assign that. Thanks rehan

Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Sept. 21
3099
1
Feb. 21
2801
1
Juni 23
4690
1
Feb. 22
5884
1
Nov. 20
2511