FreePBX contact manager sync.
Features
- Sync contacts from Odoo to FreePBX.
- Update your FreePBX contacts regulary from Odoo.
- Easy installation.
- Automatic initialization of configuration.
Installation
- Install Odoo module freepbx_contacts. Restart Odoo.
-
Login into your FreePBX server. Go the folder where you want to put the odoo_sync.py script. For example, /opt/odoo_sync. Below you can find the installation session:
mkdir /opt/odoo_sync cd /opt/odoo_sync # Install dependencies pip install mysql-connector-python # Download odoo script and make it executable. Replace your.odoo.server to your data. curl -v http://your.odoo.server/freepbx_contacts/static/files/odoo_sync.py > odoo_sync.py chmod +x odoo_sync.py # Initialize and download config file. curl -v http://your.odoo.server/freepbx_contacts/init_cfg > odoo_sync.cfg # Edit odoo_sync.cfg and adjust your local settings if required. # Run the script to test it. No output means all is fine. python ./odoo_sync.py
Decide how often you want to sync your partners to FreePBX and create a cron job for this. For example this will call sync script every hour:
echo '0 * * * * (cd /opt/odoo_sync && /opt/odoo_sync/odoo_sync.py)' | crontab -u root -
Warning! This will overwrite your root crontab. If you have existing crontab edit it manually withcrontab -e
.If you are not able to serve a single db using database of dbfilter then you need to create odoo_sync.cfg manually. Here is an example:
[odoo] db=odoopbx_13 url=http://demo.odoopbx.com token=99f649d0909c454a920c5aaec8c4373a [mysql] host=localhost user=root passwd= db=asterisk
Do not forget to add freepbx.token System Parameter (see below).
FAQ
How to reset authentication token?
The auth token is stored in Technical -> System Parameters under freepbx.token param.
You can change it there and also update your odoo_sync.cfg file on your FreePBX server.
My odoo_sync.cfg file contains 403 Forbidden Already initialized!
This is because you already used init procedure. In order to generate a config file remove
freepbx.token param from Technical -> System Parameters and call init_cfg URL again
(see the Installation section above).
RequestsDependencyWarning
If you get:
/usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.2.1) doesn't match a supported version!then upgrade requests library:
pip install --upgrade requests
Support
For support and communication please visit OdooPBX.com forum and ask questions there.
Once the user has seen at least one product this snippet will be visible.