简体   繁体   中英

How to inherit controller of a third party module for customization Odoo 12?

I have a module with a controller and I need to inherit it in a newly created module for some customization. I searched about the controller inheritance in Odoo and I found that we can inherit Odoo's base modules' controllers this way:

from odoo.addons.portal.controllers.portal import CustomerPortal, pager as portal_pager, get_records_pager

but how can I do this for a third party module's controller? In my case, the third party module directory is one step back from my own module's directory. If I should import the class of a third party module controller, how should I do it?

It is not a problem whether you are using a custom module.If the module installed in the database you can import as from odoo.addons .

Eg : from odoo.addons.your_module.controllers.main import MyClass

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM