Sub-Domain or Exposing Port for Odoo
Odoo cannot be routed through proxy on the same domain as other Bahmni services. So either it can be accessed directly on port 8069 or through a sub-domain mapping to the same public IP address as Bahmni. The index page of Bahmni detects the URL by which you access the server and if it an IP or localhost, the redirection happens to http://<ip/localhost>:8069
and if it is a FQDN, the redirection happens to erp-<your-fqdn>
. The prefix erp
is a configuration and it can be configured from here. Based on the prefix, you can create a A record that maps the domain to the server IP address in your DNS provider. For a production system accessed over internet it is recommended to setup the domain based routing and add an SSL certificate.
One-time Setup for Odoo 10
The below steps needs to be performed only once when Odoo is created .and is applicable only if you are running Odoo 10
Once the container spins up, login to the application.
Navigate to
Apps
from the menu bar.Click on
Bahmni Account
app and then click onUpgrade
.Wait for the upgrade to complete and you will redirected to home page.
After redirection, refresh your page once.
Now Odoo should be working fine. If you don't see old patient data coming into Odoo in 10 mins, please read Odoo not synchronizing old patient data.
Environment Configurations
Odoo Variables
Variable Name | Description | |
---|---|---|
ODOO_IMAGE_TAG | This value tells which image version to be used for ODoo Odoo Application. List of tags can be found at bahmni/odoo-10 16 - Tags . | |
ODOO_DB_IMAGE_NAME | This value tells which image to be specifies the database image used for Odoo Database. There are two variants available. | |
ODOO_DB_HOST | This value specifies the host name for the database to be used by Odoo. | |
ODOO_DB_USER | This value is used as username for Odoo Postgres DB instance. This is also referenced in Odoo application. | |
ODOO_DB_PASSWORD | This value is used as password for Odoo Postgres DB instance. This is also referenced in Odoo application.ODOO_DB_DUMP_PATH | |
When you want to restore an existing database of Odoo from a dump file you can set the folder path to your dump file with this variable. This is a one time setup and the restore happens only when the database is clean and fresh. So whenever you need a restore make sure you follow the steps in Cleaning Application data | EXTRA_ADDONS_PATH | When you want to installl an additional addon, you can set the path of the root directory which contains your module directory. |
Odoo Connect Configurations
Variable Name | Description |
---|---|
ODOO_CONNECT_IMAGE_TAG | This value tells which image version to be used for Odoo Connect Application. List of tags can be found at bahmni/odoo-10 - Tags . |
Odoo not synchronizing old patient data
Perform the followinng steps if older patient data is not being sent to Odoo. This likely happened because the ATOM Feed reader has already exhausted its max retry limit for failed events (by default set to 5 times). You can set the Failed events retry back to 1, and that should sync them immediately. Steps to fix this:
Open terminal in your local machine, in
bahmni-docker
folder.Execute
docker ps
to see the list of running containers.Connect to the Odoo postgres DB container by executing the command:
docker container exec -it bahmni-docker_odoodb_1 /bin/bash
wherebahmni-docker_odoodb_1
is the name of the odoo postgres container. You should now be within the container.Connect to the postgres console using command:
psql -Uodoo odoo
. For more info on how to connect to Bahmni Databases, refer to this wiki page: Connecting to various databases.In the psql prompt type:
select count(*) from failed_events;
This will show you the number of failed events.If 1 or more events are there, then you can fire the query:
select id,retries from failed_events;
. You should see all failed events have reached their retry limit.Fire an update statement to reset the retry count for all failed events:
update failed_events set retries=1;
Now in about a minute, all failed events should be processed and old patient data should get synced to Odoo.
To exit the container, first type
\q
to exit postgres shell, and then typeexit
to exit bash shell without stopping the postgres container.
Loading Additional Addons to Odoo
When you want to load additional addons to Odoo instance, you can set the EXTRA_ADDONS_PATH with the directory that contains your modules.
Bring down Odoo if it is already running by doing docker-compose down .
Set the path of your root directory of modules to EXTRA_ADDONS_PATH variable.
Restart Odoo instance by running
docker-compose up
Login to the application
Navigate to
Settings
page in the web and enable Developer ModeNavigate to Apps page and Click on
Update Apps List
Your new module will be listed and you can install it.
For example you can download Open HRMS modules from here which provides a complete HR Management System. You need to extract the downlooaded zip file and set the extracted folder path to EXTRA_ADDONS_PATH.
Note: Make sure the addons are compatible with Odoo v10.0Note: If you want to add additional addons for Odoo 10, update value for EXTRA_ODOO_10_ADDONS_PATH
in the .env files
Development setup for Bahmni Odoo Modules
Note: Do these steps only if you need to development setup and update Bahmni Odoo modules.
Clone the Bahmni/bahmni-odoo-modules repo at https://github.com/Bahmni/bahmni-odoo-modules.git
Bring Bahmni down by running
docker-compose down -v
frombahmni-docker/bahmni-standard
directory.Update the
BAHMNI_ODOO_MODULES_PATH
variable in .env file with the cloned directory path. Also update COMPOSE_PROFILE=odoo so that only odoo services start.Now in
docker-compose.yml
uncomment the volume commented under odoo service.Start Odoo services by running
docker-compose up
Enable developer mode in Odoo by navigating to
Settings
page in Odoo Web and clickActivate the Developer Mode
After you perform a change, do the following steps to reflect the changes.
Run
docker-compose restart odoo
Now in the browser navigate to
Apps
menu. Click on the app that is updated and clickUpgrade
.Now you should see the changes reflected. If not try from Step 8 & 9 once again.