Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][IMP] resource_booking: No create/unlink call if nothing to do #113

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions resource_booking/models/resource_booking.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,10 @@
to_create.append(meeting_vals)
else:
to_delete |= one.meeting_id
to_delete.unlink()
_self.env["calendar.event"].create(to_create)
if to_delete:
to_delete.unlink()

Check warning on line 421 in resource_booking/models/resource_booking.py

View check run for this annotation

Codecov / codecov/patch

resource_booking/models/resource_booking.py#L421

Added line #L421 was not covered by tests
if to_create:
_self.env["calendar.event"].create(to_create)

@api.constrains("combination_id", "meeting_id", "type_id")
def _check_scheduling(self):
Expand Down
Loading