31,029
edits
| Line 62: | Line 62: | ||
=== Synchronisation des événements Dolibarr vers Google Agenda === | === Synchronisation des événements Dolibarr vers Google Agenda === | ||
{{ToTranslate}} | |||
The other feature is to write/update an event into Google Calendar, each time an event is added/updated into Dolibarr. | |||
For this, go onto module setup page, tab "Sync to Google Agenda", and set "Create a Google event into Google Calendar when creating a Dolibarr event" to "Yes". | |||
Then, you must setup and enter the API keys provided by Google. This is dones in several step. | |||
1) Find the Google Agenda ID or your calendar. | |||
Go into your Google Calendar, then "Parameters" in the wheels, then tab "Agenda", or try this link https://www.google.com/calendar/render#i and then click on name or your Agenda. You Agenda ID is an ID that looks like an email. | |||
Fille this ID found into field "ID Agenda". | |||
2) You must create a service account user/email from page https://code.google.com/apis/console/, menu "API & Authentication" -> "Credentials" . Click on "Create a client ID" and choose "Service Account" then "Create". You will get a new service account with a Service account client ID and a Service account EMail. You need here to enter the Service account EMail. | |||
Note: A popup to download a file (used by next step) | |||
3) Once you have you created your service account user/email (see note on previous fields), you must download your security p12 file (or use the one downloaded at previous step). Return on https://code.google.com/apis/console/ and select "API & Authentication" -> "Credentials". Then Click on "Generate a p12 key" to download the file on your desktop. Then submit it using this form. | |||
4) You must also enable the API for your Google account. For this go on page https://code.google.com/apis/console/, menu "API & Authentication" -> "API". Click to enable API for "Calendar API". | |||
5) You must also share the agenda (all permissions) with the service account user/email (created at step 2): For this, go into Google calendar, choose "Parameters" then tab "Agendas" (direct access with this link https://www.google.com/calendar/render?tab=mc#i). Click on link "Share parameters" at end of line of the Agenda to synchronize (It must be same Agenda than the one choosed on parameter "ID Agenda" at step 1). Then add the service account user into the email field, choose permission "Edit events" and validate by clicking "Add user". | |||
With Google Apps for work (not required for standard gmail account), permissions may be forced to "Ready only" instead of "Edit". To solve this, go onto https://admin.google.com/AdminHome#AppDetails:service=Calendar&flyout=sharing and check that sharing option of Agenda application allows sharing with external service account. [[File:Warning.png]] A 24h delay may be required to be able to return and finish step 5. | |||
Once all steps are done, you can use the button to make a synchronization test. Click on it to make a test. | |||
'''TroubleShooting''' | |||
* If you receive error "ERROR Error calling POST https://www.googleapis.com/calendar/v3/calendars/yourcalendarid/events: (404) Not Found": Check the step 5 was done. | |||
* If you receive error "ERROR Error calling POST https://www.googleapis.com/calendar/v3/calendars/yourcalendarid/events: (403) Forbidden": Check the step 5 was done and that permission granted was read and write and not read only. | |||
* [[File:Warning.png]] Note: A possible error is that Google denies access, even if login and password are correct, but just because the server that host Dolibarr is located into another country than country you are using google apps usually | |||
To check Google has locked your access for this reason, go onto page https://security.google.com/settings/security/activity?hl=fr after failure. | |||
If it appears Google has blocked access attempts from an unusual location, accept this attempt. Then, you must wait 24 hours to try again. | |||
* [[File: Warning.png]] Note: Another possible error is that Google denies access even if your login and password are correct, because you turn on Google option 2-step validation. To check if you have actually enabled this option, go to the page: https://security.google.com/settings/security?pli=1 | |||
If in the "Validation in two stages," you have "On", the problem is found. You do not have to disable it. You can solve the problem as follows: | |||
Click "Edit" next to the title of the "Validation in two steps." | |||
Click the link "Manage passwords specific to applications". Enter a name, for example "Google Access for Dolibarr" and confirm. A password will be provided. | |||
Return to the configuration page of Google Dolibarr module and enter this password in the configuration page of the module, instead of your regular password, then click '''Save'''. | |||
Retry the test synchronization. | |||
== Configuration Google Contacts == | == Configuration Google Contacts == | ||