How it works...

The two crucial parts here are that our controller is derived from odoo.http.Controller, and that the methods we use to serve content are decorated with odoo.http.route. Inheriting from odoo.http.Controller registers the controller with Odoo's routing system in a similar way to how the models are registered, by inheriting from odoo.models.Model. Also, Controller has a metaclass that takes care of this.

In general, paths handled by your add-on should start with your add-on's name, to avoid name clashes. Of course, if you extend some of the add-on's functionality, you'll use this add-on's name.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset