Bahmni/odoo-10 image is based on Odoo v.10 which acts as an inventory management system with Bahmni. The image is built and published using Github actions from odoo-modules repository.
Bahmni/odoo-connect image is used to enable atomfeed sync to fetch drugs, lab-tests, patient medication orders to Odoo. The image is built and published using Github actions from openerp-atomfeed-service repository.
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
The below steps needs to be performed only once when Odoo is created.
Once the container spins up, login to the application.
Navigate to Apps from the menu bar.
Click on Bahmni Account app and then click on Upgrade.
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.
This value tells which image version to be used for ODoo Application. List of tags can be found at bahmni/odoo-10 - Tags .
This value tells which image version to be used for Odoo Database. There are two variants available. fresh db - Has only schema and default data. demo db - Has schema and demo data loaded. List of image tags can be found at bahmni/odoo-10-db - Tags .
This value is used as username for Odoo Postgres DB instance. This is also referenced in Odoo application.
This value is used as password for Odoo Postgres DB instance. This is also referenced in Odoo application.
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
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
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 where bahmni-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 type exit 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 Mode
Navigate 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.0
Development setup for Bahmni Odoo Modules
Note: Do these steps only if you need to update Bahmni Odoo modules.