9 Commits
Author SHA1 Message Date
ahmad(alah) 0c871fcb6d [FIX] google_calendar: toggle all-day field
Before this commit when we have a synced event with google and then we toggle the all-day field
changes didn't reflect on google side

This happened because google uses two separate fields for start/end.
1. dateTime (used for normal events)
2. date (used for all-day events)
when one of them is set, the other must be null.
Before this commit when we did a patch update, we set only one, but forget about the other which raises an error.

closes odoo/odoo#157664

Task: 3681668
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-04-19 09:20:26 +00:00
ahmad(alah) 73627b45eb [FIX] google_calendar: accepting recurrent event tests
The `test_accepting_recurrent_event_*` tests make sure that accepting recurrent events on google side reflect in odoo.
The test was failing because of the following:
when retrieving the invited attendee, the test used `self.assertEqual(event.attendee_ids[1].state, expected_states[i])` assuming that organizer will be at index `0` and invited user at index `1`.
However the list of `event.attendee_ids` is ordered by create_date.
And we create both organizer and attendee with the same command at the same time: `partner_ids=[Command.set([self.organizer_user.partner_id.id, self.attendee_user.partner_id.id])]`
So we might have organizer at index `1` and invited attendee at index `0`. This resulted in the indeterministic behavior of the test.

To fix this issue:
This commit changes how the invited attendee is retrieved, making sure that we always get the right attendee.

fixes runbot-61527

closes odoo/odoo#162279

X-original-commit: 6db2614283abfc035343f021b9cfc52609aa9d44
Signed-off-by: Ahmad Almaghraby (alah) <alah@odoo.com>
2024-04-18 21:06:44 +00:00
ahmad(alah) f31174e021 [FIX] google_calendar: updating recurrent events on google side
Before this commit when accepting a recurrent event from google calendar with option "this event", it didn't reflect on odoo calendar.
This happened due to the write_date check which applies google update only if their write_date is after odoo write_date,
but multiple updates from google might change some events write_date to now, which causes other google updates to get discarded.

This commit aims to fix this issue by keeping the write_date of the affected events before applying any google updates, and considering these dates instead of the live odoo write_date.

closes odoo/odoo#160357

Task: 3731552
X-original-commit: 3bcf6c458a4b483af6467d1c027b60771d1ce08d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-04-04 11:48:12 +00:00
ahmad(alah) b3a20345a3 [FIX] calendar: test calendar month view start hour displayed
The `test_calendar_month_view_start_hour_displayed` makes sure that start hour is displayed in calendar month view.
The test was failing before 09:00 AM because after creating the event, it sets the start time to 10:00 without setting the stop time or duration.
So when creating this event before 09:00 with a default duration of 1 hour, the stop time would be before 10:00, and it would raise an error.

This commit aims to fix this issue by adding a step to set the duration of the event, avoiding the potential error.

fixes runbot-59850

closes odoo/odoo#157263

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-03-15 13:04:50 +00:00
ahmad(alah) 8fd5c00ebd [FIX] calendar: hide res model name while creating an event from another model
Before this commit when you create an event from a lead, a button appears to jump back to the lead but while you're creating the record, it already appears but empty.
This commit hides the button in case the res_model_name is null, which happens while we are creating the event and before hitting save.

closes odoo/odoo#154956

Task: 3747059
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-03-07 08:25:53 +00:00
ahmad(alah) 58b13d8328 [FIX] calendar: test calendar month view start hour displayed
The `test_calendar_month_view_start_hour_displayed` makes sure
that start hour is display in calendar month view.

The test was failing because when clicking on scale selector,
it used '.dropdown-toggle:contains("Week")' however it might
happen that the current scale is not week.

This commit fixes this issue by changing the way we access
the scale selector.

fixes runbot-59023

closes odoo/odoo#156121

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-03-04 08:12:02 +00:00
ahmad(alah) de702b0071 [FIX] microsoft_calendar: update outlook button after sync restart
Before this commit: the Outlook button status did not update automatically when we restart the sync.
This commit aims to fix the issue by using state for reactive values that control the button state.

closes odoo/odoo#155174

Task: 3731623
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-03-04 08:11:56 +00:00
ahmad(alah) 13895cc379 [FIX] google_calendar: update google button after sync restart
Before this commit: the Google button status did not update automatically when we restart the sync.
This commit aims to fix the issue by using state for reactive values that control the button state.

Task: 3731623
Part-of: odoo/odoo#155174
2024-03-04 08:11:56 +00:00
ahmad(alah) 58ff184080 [FIX] Work Entries - Contract: updating contracts without employee.
When updating contracts, work entries are recomputed automatically for the employee linked to that contract.
However some contracts might not have an employee, which raises an error.

Added a check to recompute work entries only if the contract has an employee.

closes odoo/odoo#151190

Task: 3614495
X-original-commit: 3a4683ae8159bf405513a901b1fd3bba72a05fb7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-01-29 12:05:15 +00:00