Creating a basic module
In Odoo, tasks are performed by creating modules.
Modules customize the behavior of an Odoo installation, either by adding new behaviors or by altering existing ones (including behaviors added by other modules).
Odoo's scaffolding can setup a basic module. To quickly get started simply invoke:
$ ./odoo-bin scaffold Academy my-modules
This will automatically create a
my-modules
module directory with an
academy
module inside. The directory can be an existing module directory
if you want, but the module name must be unique within the directory.
A demonstration module
We have a "complete" module ready for installation.
Although it does absolutely nothing we can install it:
-
start the Odoo server
$ ./odoo-bin --addons-path addons,my-modules
- go to http://localhost:8069
- create a new database including demonstration data
- to go
- in the top-right corner remove the Installed filter and search for academy
- click the Install button for the Academy module
To the browser
Controllers interpret browser requests and send data back.
Add a simple controller and ensure it is imported by __init__.py
(so Odoo can find it):
Shut down your server (^C
) then restart it:
$ ./odoo-bin --addons-path addons,my-modules
and open a page to http://localhost:8069/academy/academy/, you should see your "page" appear:
Website support
Controllers interpret browser requests and send data back.
Add a simple controller and ensure it is imported by __init__.py
(so Odoo can find it):
Shut down your server (^C
) then restart it:
$ ./odoo-bin --addons-path addons,my-modules
and open a page to http://localhost:8069/academy/academy/, you should see your "page" appear: