Usage¶
How to use the Odoo Build project.
Create a new module from source¶
Create a new module.
Add a new model.
Add model security.
Generate module docs.
Load modules from external folder¶
To load modules from a external folder, set this env var in your .env file:
The paths will be appended to the Odoo config.
Initialize without demo data¶
In your .env file set this env var:
Pint Odoo database name¶
The default database name is the checked out Odoo version.
To define another name, set this env var in your .env file:
Disable browser open¶
To disable the browser open when starting the Odoo server edit the .env file:
Set podman as container engine¶
If you are using podman, set this .env var:
Change log level¶
To change the log level of Odoo set this env var in your .env file:
Stop all containers¶
Without service name the stop commands stops all containers.
Remove containers¶
Removes containers and volumes.
Drop database¶
To drop the default database run:
Pin Postgres image version¶
Define the Postgres image in your .env file:
Setup mail catcher¶
Start mailpit server.
When you send mails in Odoo they will be catched and shown on http://localhost:8025/.
Forward mails with Odoo Mailgate¶
Start all containers.
Initialize the Odoo database.
Log into Odoo and setup an alias for info@yourcompany.com.
Send a test mail with swaks:
swaks --to info@yourcompany.com --from sender@example.com \
--server localhost:25 \
--body "This is a test email for the Odoo mailgate system." \
--header "Subject: Test Email for Odoo"
The mail will be forwarded to Odoo.
Trace the mailgate log with:
You can also send a mail with tls encryption:
swaks --to info@yourcompany.com --from sender@example.com \
--server localhost:587 \
--tls \
--body "This is a test email for the Odoo mailgate system." \
--header "Subject: Test Email for Odoo"
Debug Odoo with VSCode¶
In VSCode define a break point for a selected method.
Run Odoo source with a debugger.
In VSCode run Python - attach debugger to attach the debugger.
Open http://localhost:8069 and run the method that you want to debug.
VSCode should jump to the breakpoint and you can step through the method.
Profile Odoo memory usage¶
Run Odoo with memray.
Open http://localhost:8069 and finish the recording with ctrl+c.
The flamegraph report will be generated and opened.
Profile Odoo execution time¶
Run Odoo and get the process id.
Record the Odoo process with py-spy.
Finish the recording with ctrl+c.
The browser will open https://www.speedscope.app/. Upload the tmp/speedscope-profiling.json file.
Show module depdency tree¶
Use the manifestoo command to reason about module dependencies. The --addons-path will be provided.
Here is an example output: