Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3960 มุมมอง

 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

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 21
3001
How to learn odoo pos technical แก้ไขแล้ว
1
ก.พ. 21
2651
1
มิ.ย. 23
4579
1
ก.พ. 22
5786
[v13] Help overriding _display_address แก้ไขแล้ว
1
พ.ย. 20
2432