diff options
| author | jke-openerp <jke@openerp.com> | 2013-12-19 17:50:11 +0100 |
|---|---|---|
| committer | jke-openerp <jke@openerp.com> | 2013-12-19 17:50:11 +0100 |
| commit | 59c932477edf0ccff68dfa18e97a3bd76b6e251d (patch) | |
| tree | 5dea6333c5e9ff13d6bb8f69bbcf5f9a0ae96039 /addons/google_calendar/static/src | |
| parent | e70d4e88ae2b7f36ab8570a747fcb8e382d5e193 (diff) | |
[IMP] Redirect admin to configurations page for Google Calendar API when trying synchro but not still configured
bzr revid: jke@openerp.com-20131219165011-xgy18qcr1n1q4jz1
Diffstat (limited to 'addons/google_calendar/static/src')
| -rw-r--r-- | addons/google_calendar/static/src/js/calendar_sync.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/addons/google_calendar/static/src/js/calendar_sync.js b/addons/google_calendar/static/src/js/calendar_sync.js index dd5ae718e46..39bdb8144eb 100644 --- a/addons/google_calendar/static/src/js/calendar_sync.js +++ b/addons/google_calendar/static/src/js/calendar_sync.js @@ -32,8 +32,16 @@ openerp.google_calendar = function(instance) { window.location = o.url; } else if (o.status == "NeedConfigFromAdmin") { - alert(_t("Admin need to configure Google Synchronization before to use it !")); - window.location = o.url; + + if (typeof o.action !== 'undefined' && parseInt(o.action)) { + if (confirm(_t("An admin need to configure Google Synchronization before to use it, do you want to configure it now ? !"))) { + self.do_action(o.action); + } + } + else { + alert(_t("An admin need to configure Google Synchronization before to use it !")); + } + //window.location = o.url; } else if (o.status == "NeedRefresh"){ self.$calendar.fullCalendar('refetchEvents'); |
