Override python function in odoo

前端 未结 1 325
挽巷
挽巷 2021-01-26 20:12

I make some changes in the read_group function which is located in the odoo/server/openerp/models.

What I need now is to override this

相关标签:
1条回答
  • 2021-01-26 20:51

    Please find the example as below

    from openerp import models
    def read_group():
        #YOUR OVERRIDDEN Function
    
    models.BaseModel.read_group = read_group
    

    For New API and old API compatibility issue you can also use _register_hook as given in example on this link. https://stackoverflow.com/a/34854721/1451220

    0 讨论(0)
提交回复
热议问题