Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4120 Visualizzazioni

 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
Abbandona
Risposta migliore
from odoo import api

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

api.split_context = new_split_context                                             
Avatar
Abbandona
Autore

Oh I forgot to assign that. Thanks rehan

Post correlati Risposte Visualizzazioni Attività
1
set 21
3145
1
feb 21
2850
1
giu 23
4758
1
feb 22
5957
1
nov 20
2540