Commit Graph

58 Commits

Author SHA1 Message Date
Denis Ledoux 644bb3d674 [FIX] google_calendar: default timezone
If no timezone was defined for the user,
the timezone sent to Google for the events
syncrhonization was set as `False` instead
of the right default value `UTC`

opw-660171
2015-12-18 14:31:10 +01:00
Nicolas Martinelli de1fb68444 [FIX] google_calendar: fix error type
The call to delete_an_event calls the method _do_request, which will
throw a urllib2.HTTPError.

opw-652219
2015-10-16 10:26:41 +02:00
Denis Ledoux e509f9155b [FIX] google_calendar: all day event stop date
For an event during all day, during 2 days,
e.g. September 9th and September 10th,
Google expects as start date the first day, and as
stop date the day after the last day.
e.g.
start 2015-09-09
stop 2015-09-11

Even if, afterwise, in the Google Agenda interface, it will
be correctly displayed 2015-09-10 as end date.

This must be applied at the event creation AND at the event
update. It was not the case until this revision.

Besides, we now use the event `stop_date` in Odoo, instead
of the duration, in case the duration has been incorrectly
computed.

opw-648867
2015-09-08 17:21:20 +02:00
Denis Ledoux 3c0fe940aa [FIX] google_calendar: force internal id only on creation
This rev. is related to 1c533b193f

The reason why we force the event Google internal id is
explained in the above commit.

Forcing the internal id must be done only when creating the
event in Google, not when updating, for retro-compatibility:
if the event is already in the attendee calendar, with a different
internal id then the other attendee, we must leave it like this,
otherwise Google will be lost.
2015-09-01 17:36:52 +02:00
Denis Ledoux 1c533b193f [FIX] google_calendar: events disappearing
This rev. is related to a9e3d74713

This new revision is about the same use case than above, except
that both Google users login doesn't match the Odoo login email.

e.g.
User A: A@agrolait.com in Odoo, A@gmail.com in Google
User B: B@agrolait.com in Odoo, B@gmail.com in Google.

When A creates an event, with B in the attendees, and
syncs his calendar to Google, B is not automatically invited
Google side, as his attendee email is B@agrolait.com, which
doesn't match any existing Google User (doesn't match B@gmail.com)

While the revision mentioned above, a9e3d74713,
expected the attendee to be automatically invited Google side, and therefore
expected the event to already exists in B's calendar.

Therefore, when B syncs his calendar in Odoo, as the event
was there in his Odoo calendar, but not in his Google Calendar,
the code actually think it's no - longer - there, and take the assumption
the event has been deleted Google side. So, it deletes the event
in Odoo side as well, for both users A & B.

To overcome this new issue, when the Google & Odoo users emails
do not match, while keeping the compatibility when the Google & Odoo
emails do match (and therefore the invitation is automatically sent
Google side, as the email matches an existing Google account, and
the event is automatically created in B's calendar without needing the
sync in Odoo), we now force the Google internal id to be the same
for all attendees of an event, event by Google side.

opw-645745
2015-09-01 17:15:43 +02:00
Denis Ledoux 4d9cef5412 [FIX] google_calendar: Google doesn't allow wrong attendee emails
Odoo allows bad formatted emails for partners (and attendees).
Google doesn't.
Therefore, upon sync, if the email is wrong, we do
not send it to Google, to avoid Google being mad at us.

opw-646369
2015-08-04 18:54:58 +02:00
Martin Trigaux 9abf868948 [FIX] google_calendar: missing part of caac19c1
Modify all references of google_attendee['email']
2015-07-22 12:22:35 +01:00
Martin Trigaux caac19c102 [FIX] google_calendar: attendee's email is not required
You may get a google_attendee without email from Google, cf #3853
2015-07-22 10:37:50 +01:00
Denis Ledoux b6a580a25d [FIX] google_calendar: wrong timezone
When creating an event in at 4 pm,
while being in UTC +2 (Europe/Brussels),
The start date sent to Google was set as
'2015-07-03T16:00:00+02:00',
but the timezone was described as 'UTC', giving
therefore giving contradictory information.

At the end, in the google calendar,
the event was set in the UTC timezone,
while it should have been set in GMT +2 (Europe/Brussels).

opw-640825
2015-06-26 11:37:51 +02:00
Stan fd2518eecb [FIX] google_calendar: fail during first sync
If an event exists on Google but was not synced yet in Odoo, the synchronisation
would fail.
When self.OE.found is False, self.OE.event is not defined and trying to access
it would fail (it's a python object, not a recordset)

Check the ownership after making sure the event is present in Odoo.

Fixes #7034
2015-06-11 16:21:14 +02:00
Denis Ledoux 815f91b951 [FIX] google_calendar: remove event in google while being only attendee
If User A created an event In Odoo, inviting User B,
Then, if User A sync his calendar with Google,
user B have an invitation to this event in Google,
if user B refuses the event AND remove it from his Google calendar
and then syncs his calendar to Odoo,
the event was removed from the Odoo calendar, of all attendees.

opw-641356
2015-06-02 15:04:00 +02:00
Denis Ledoux a9e3d74713 [FIX] google_calendar: event duplication during sync to google
With User A <a@gmail.com> and user B <b@gmail.com> both syncing
their calendar with Google.
If User a created an event X, adding as attendee himself and user B,
and then synced his calendar to Google, a new event was
created in User B Google Agenda automatically, representing the
invitation.
At this stage, X appears only once, in the four calendars
(Odoo cal for A, Odoo cal for B, Google Cal for A, Google Cal for B)

If user B then synced his calendar to Odoo, the event X was
duplicated in three of the calendars (Odoo cal for A and B, Google cal for B)

If then user A synced again his calendar with Google, the event X
was duplicated in the four calendars.

From then, a duplicate loop began, at each sync of the both user calendars.

opw-639419
2015-06-01 18:14:50 +02:00
Denis Ledoux f6f55d66b3 [FIX] google_calendar: get_param returns a string
while `timedelta` argument `weeks` expects an integer

opw-640976
2015-05-28 16:02:34 +02:00
Nicolas Lempereur 6d25a1a18a [FIX] google_calendar: sync date on event date change
Set the record update time when the date is changed via another view
than calendar view. So when an synchronization is done, the update is
taken into account when updating calendar from the odoo to google.

closes #6752
opw-634674
2015-05-19 09:37:28 +02:00
Denis Ledoux fb23de77a9 [FIX] google_calendar: multiple times the same reminder in an event
Use a set to prevent adding several time
the same calendar.alarm (reminder) in the same event

opw-639918
2015-05-15 14:04:55 +02:00
Jeremy Kersten 3050e35d31 [FIX] google_calendar: don't send mail from calendar when date has been changed.
If a meeting has been changed in google, a mail has been already sent.
2015-02-24 18:18:53 +01:00
Jeremy Kersten 2c09ba980d [FIX] calendar: synchro - use current user to synchronize as uid
Else, function like get_primary_calendar return values from administrator and not the user to synchronize
2015-02-18 13:00:39 +01:00
Jeremy Kersten e4030e2016 [FIX] google_calendar: write info on current user with superuser_id
If the user is not admin, it will synchronize always from start, because last_synchro_date cannot be write on res_users
2015-02-16 14:55:22 +01:00
Jeremy Kersten 9ffa3a5c15 [FIX] google_calendar: force google synchro to be without default notif 2015-02-13 16:11:51 +01:00
Jeremy Kersten aed865aa93 [IMP] google_calendar - synchronize OE alarm with google reminders 2015-02-13 13:51:00 +01:00
Denis Ledoux af8a6096c9 [FIX] google_calendar: typo, Google is not plural 2014-12-10 17:31:45 +01:00
Denis Ledoux ebca88defc [FIX] google_calendar: All exceptions types do not have read method 2014-12-10 17:31:45 +01:00
Denis Ledoux f9ad381c17 [FIX] google_calendar: deleted excluded recurring event
Do not try to delete an excluded recurrent event added in Google, but not yet syncrhonised in Odoo (immediately deleted for instance)
2014-12-09 17:13:26 +01:00
Denis Ledoux d4f91b3f98 [FIX] google_calendar: recurrent event syncrhonization
When an attendee is added exceptionnally in an instance of a recurrent event, do not try to sync the basic recurrent event in his calendar
2014-12-09 16:34:35 +01:00
Raphael Collet b8071bbaca [FIX] addons: incorrect new-api invocation of method write() with context
This fixes #3411.
2014-11-13 13:34:55 +01:00
Jeremy Kersten c04b0443b7 [FIX] google_calendar: add missing parameter to logger_info 2014-10-06 14:32:28 +02:00
Jeremy Kersten f3346223ac [IMP] Google calendar - add function to allow the cron to run google calendar synchronization 2014-10-03 17:52:31 +02:00
Jeremy Kersten 9696d76aec [FIX] google_calendar: browse user as SUPERUSER_ID to be able to write/update google_calendar info on user 2014-09-24 15:30:11 +02:00
cod-odoo 4f3db3ec04 [FIX] google_{account|calendar}: fix synchro
- no more tracebacks when trying to sync more than once with Google Calendar
- no more context hacks, explicit return of `ask_time`.

(Closes #1588)
2014-08-14 15:48:05 +02:00
rlu-odoo 8b67a7202d [REF] OpenERP --> Odoo in various UI texts
Rebranding has been done in:
- data/demo files
- html templates
- help notices
- comments
- logger messages
- and other various messages

(Commit taken from odoo-dev:8.0-improve-openerp-odoo-rlu at rev 7deaa08)

Closes #1260
2014-07-18 13:45:41 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Christophe Simonis adf07a9490 [MERGE] forward port of branch saas-4 up to 5087612 2014-06-19 16:13:35 +02:00
Jeremy Kersten 0c627438cc [FIX] Google Calendar - Split the last underscore because Google uses sometimes '_' in their own google_id. Retrieve the parent event_id to exclude when the exlusion has been done in google 2014-06-13 17:57:01 +02:00
Kersten Jeremy 02be7aa65c [IMP] Improve Calendar synchronization
- Use the new fields from calendar (renamed in 9398.1.7 trunk-cal-v8-jke)
    - Manage some google excpetions about token expiration
    - Manage some google excpetions about token revokation
    - Manage some google excpetions about 410 - Gone from google
    - Detect / Allow user to change the calendar and remove all old reference.
    - Use by default the since_modified for synchronization and not always a full (updatedTime in google)
    - Add some key for ir_parameters : 
             'calendar.week_synchro' : number of week to synchornize when we are in full mode
             'calendar.block_synchro_attendee' : need to synchronize the attendees between google and openerp (creation of partner)
             'calendar.block_since_synchro' : Always use the full synchro. (Can be forced in "one time" removing the last synchro from res_users form)
             'calendar.debug_print' : _logger is more verbose
    - Pep 8
    - Change behaviour of do_request to return a tuple with status raquest and response
    - Add field from token and synchro date in res_users view form
2014-05-14 10:28:10 +02:00
Kersten Jeremy d9c3c175bd [REF] Calendar refactoring - Manage allday in date field and not datetime.
bzr revid: jke@openerp.com-20140430093613-3tdn2tfiwshcahbz
2014-04-30 11:36:13 +02:00
Kersten Jeremy 2907c8dd66 [TYPO] PEP7 - Module calendar (no E501)
bzr revid: jke@openerp.com-20140224220222-dp26lvbv2bfljxvt
2014-02-24 23:02:22 +01:00
jke-openerp 629daccd56 [FIX] calendar, google_calendar: multiple fixes with timezones, filters, google sync and dashboards
bzr revid: odo@openerp.com-20140218171508-6li402027u57ltrx
2014-02-18 18:15:08 +01:00
jke-openerp ce28079010 [FIX] Fix bug with synchro google for recurrent event excluded
bzr revid: jke@openerp.com-20140218135009-vtuplqdhsx3qe03l
2014-02-18 14:50:09 +01:00
jke-openerp 46b0c7aa00 [REF] Rename model crm.meeting into calendar.event
Remove 2 unsused field from calendar.event model (dir,sequence)

bzr revid: jke@openerp.com-20140115093805-1g1j1oymyxsb6kgh
2014-01-15 10:38:05 +01:00
jke-openerp 53264da08a [REF] Add order fix on calendar list view, flake google_calendar, undelete function get_sequence needed for google synchro
bzr revid: jke@openerp.com-20140114133736-cvvftr4hmaa3w3ad
2014-01-14 14:37:36 +01:00
jke-openerp c5791441c4 [REF] Refactoring according to CHS and AL review
bzr revid: jke@openerp.com-20140113174157-ins4vf57g0p6v82u
2014-01-13 18:41:57 +01:00
jke-openerp c274b28f4a [TYPO] cleaning
bzr revid: jke@openerp.com-20131220160818-56skpmvbzub6mn1r
2013-12-20 17:08:18 +01:00
jke-openerp 6bb986a2e5 [FIX] Fix according to APR's Review
- Access Right too restrictif for user
- Bug UI between Firefox and Chrome
- Bug UI many2many_tag cursor on bullet
- Temp Fix on email_template to manage partner_to
- Manage attendee from hr_holidays 
- Manage avatar_model in sidebar_items for filter (res.partner was hard coded)
- Remove quick add from HR-holiday, because some field (as day) is calculated on event "onchange"

bzr revid: jke@openerp.com-20131220141855-mbhxtr07fn0sroe0
2013-12-20 15:18:55 +01:00
jke-openerp 5564d4e23e [IMP] Improve perf of google synchro to avoid a duplicate update, we use now a key in context "NewMeeting" to avoid to update the meeting oe_update, when we create the attendee for the first time, so we dont make a synchro from OE to GG when an new event form GG is created the last synchro
bzr revid: jke@openerp.com-20131220095720-lpl2hn2890wbeu6v
2013-12-20 10:57:20 +01:00
jke-openerp 6473e55ea3 [IMP] Remove constraint on google_internal_event_id on attendee because google share them ID between the attendees
bzr revid: jke@openerp.com-20131219210628-3sza94f02z2lj3zn
2013-12-19 22:06:28 +01:00
jke-openerp 59c932477e [IMP] Redirect admin to configurations page for Google Calendar API when trying synchro but not still configured
bzr revid: jke@openerp.com-20131219165011-xgy18qcr1n1q4jz1
2013-12-19 17:50:11 +01:00
jke-openerp 3d04737ab1 [TYPO] Rename google_base_account into google_account
bzr revid: jke@openerp.com-20131219142514-8epaqnt0mb16xd4n
2013-12-19 15:25:14 +01:00
jke-openerp dc7660414a [FIX] Use superuser to upate users token from google_calendar.set_all_token
bzr revid: jke@openerp.com-20131218174931-q0nz4xji5metspoz
2013-12-18 18:49:31 +01:00
jke-openerp 6a0b69a7e7 [IMP] Add Demo data, Test on Event, Test en recurrence + [FIX] google_event__internal_id size changed, because more than 128 char for some users
bzr revid: jke@openerp.com-20131218110418-wdubheq1by0j0daf
2013-12-18 12:04:18 +01:00
jke-openerp affb77ed71 [IMP] Improve perf of google calendar synchro, add demo data for Calendar
bzr revid: jke@openerp.com-20131217204238-sat6h8jc600d1n69
2013-12-17 21:42:38 +01:00