Google Calendar for OpenERP 7.0 installation notes
- To install google api client
Before you are able running this module you must install google api client for python :https://developers.google.com/api-client-library/python/start/installationNow install the google_api module in your OpenERP 7.0 system. If any errors occur this has to do with the needed dependencies the module need (apiclient, httplib2, oauth2client, uritemplate, argparse).
- Setup google account to use google api
In Settings->Users->Users enable “Google API / Manager” in “Access Rights” for those users having admin rights. Enable “Google API / User” for those users you want to have synchronization enabled for there calendars.
Setup a google account for using google api:https://code.google.com/apis/console/Follow the instructions by google to create such an account if you haven’t got one yet. In the console create a new project. Give it a name (for example: API Project). Go to the “Services” section of your created project and switch “calendar API” to “on”.Now go to the “API settings” section of your project and click on “Create another client ID …” and select “Installed application” as Application type. Select “other” as Installed application type (this option will be visible after selecting the correct Application type). Now click on “Create client ID”.Now you have a “Client ID for installed applications” with a Client ID, Client secret, Redirect URIs. On the right you see a button “Download JSON”. Click on this button and save this file on a location where your OpenERP system has access to it (read/write).
- Authorize the google calendar to be managed by openERP
In OpenERP login as admin, you have a menu “Google API”. Create an account for accessing your google API. Go to “Google API->Configuration->Accounts”. Click on the create button ,give your account a name.In “Secrets path” enter the full path of your json file you just have downloaded (example: d:openerpspecialgoogle_calendarclient_secrets.json). In “Credential path” enter a full path (filename included) where google_api will find/create the credential file (example: d:openerpspecialgoogle_calendar credentials.dat). The first time this credentials file does not exists.When you’re done save your account, click on this button “Authorize” becomes red. To test if everything is correct.It’s important that you have your browser opened on the same machine as OpenERP-Server is running.If everything goes well a new page opens in your browser, asking to accept that the openERP module google_api wants to manage your calendars and to view your calendars (if not visible you have to login first). Click the accept button. Now the credential file is created.If you have problems using this method deactivate “Use local browser” in “Google Api->Configuration->Accounts->[your account]”, stop your OpenERP-Server and run it in interactive mode (on ubuntu from the location where you installed OpenERP-Server: ./openerp-server -c /etc/openerp-server.conf).After clicking the “Authorize” button in your terminal you see a link. Copy this link and paste it in a browser on a device where this is possible. Here you will receive a code, enter this code in your terminal where the system is waiting for it. Stop OpenERP-Server and start it again the way you always do.
- Setup Calendar you want to sync.
The last thing you have to do is to create calendars in your account you want to sync with OpenERP. For each user you want to have this option you must create one calendar. See http://www.google.com/calendar to create your calendars. Don’t forget to share this calendar with the user for whom this calendar is. This user also must have a google account.In the calendar settings you have a Privat address with a little xml button.Click on it and copy the link into an text editor.
The link looks like:https://www.google.com/calendar/feeds/ghzfw33qcgtoahz1hq7cdsj321%40group.calendar.google.com/private-35403bc2f4aad7ce56b21a976516b21/basic
Now copy the string between “feeds/” and “/private”, you have something like this:ghzfw33qcgtoahz1hq7cdsj321%40group.calendar.google.com
Replace “%40” with the “@” sign, resulted in the following Google calendar id:firstname.lastname@example.org
Go back to OpenERP and create a calendar (Google Api->Configuration->Calendars”. Here you must select the account you just have created, the user this calendar belongs to and the “Google calendar id”.Save your data and click the button “Synchronize” to test it. In Messaging->Organizer->Calendar you can see if events were created/changed and/or deleted.The module google_api synchronizes every 15 minutes. You can change this in Settings->Technical->Scheduler.