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

[IMP+FIX] resource_booking: duration, location, involves me, hr_holidays_public #34

Merged
merged 5 commits into from
Jul 27, 2021

Conversation

yajo
Copy link
Member

@yajo yajo commented Jul 22, 2021

This PR includes several improvements or fixes for the resource_booking module:

[IMP] resource_booking: use duration field instead of stop

From now on, resource.booking.type duration represents the default duration that will be applied to new resource.booking of that type, instead of the hardcoded duration for every new booking.

This means that you can create a new booking in pending state and define a custom duration before sending the portal link to customer.

Thus, the available schedule slots in portal will be based on the type duration, whereas only those that have enough time left to complete the booking duration will be displayed.

image

[IMP] resource_booking: configurable auto-assigned combination and location

Thanks to this patch, you will be able to more predictably block the chosen resource combination, with the added checkbox.

Also, the location field is propagated to resource.booking records, and synced from there to calendar.event if needed. This way, you can alter the location before sending the portal invitation.

image

[FIX] resource_booking: "Involves me" filter

The filter wasn't working fine due to the auto_join=True set in meeting_id. It was never displaying pending bookings.

Besides, it wasn't necessary to keep it as a field because it was displayed nowhere and the search could be done directly in the view. This way, there's less python code to maintain and we disable the possibility of having a negative domain, which enters doomed scenarios when x2many fields are involved (see odoo/odoo#43957).

[IMP] resource_booking: compatible with hr_holidays_public

Adding .with_context(exclude_public_holidays=True) in needed places to let hr_holidays_public do its magic and never allow allocating a booking during a public holidays when that module is properly installed and configured.

image

[IMP] resource_booking: optional name propagated to meeting

  • Allow users to optionally define a name for the resource booking.
  • Display that name in portal if set.
  • Sync it with meeting name when creating it.
Peek.27-07-2021.09-55.mp4

@Tecnativa TT30987

@pedrobaeza pedrobaeza added this to the 13.0 milestone Jul 22, 2021
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a functional review, everything goes correct, but the booking confirmation shows the incorrect duration:

Selección_014

@yajo yajo force-pushed the 13.0-resource_booking-imp_multiplier branch from b14a37f to c7a4ddf Compare July 23, 2021 09:30
@yajo yajo marked this pull request as ready for review July 23, 2021 09:30
@yajo
Copy link
Member Author

yajo commented Jul 23, 2021

All done. Please keep in mind that this will have to be merged with "nobump", as it includes the version bump needed to test migration scripts.

Jairo Llopis added 2 commits July 23, 2021 14:03
From now on, `resource.booking.type` duration represents the default duration that will be applied to new `resource.booking` of that type, instead of the hardcoded duration for every new booking.

This means that you can create a new booking in pending state and define a custom duration before sending the portal link to customer.

Thus, the available schedule slots in portal will be based on the type duration, whereas only those that have enough time left to complete the booking duration will be displayed.

@Tecnativa TT30987
…cation

Thanks to this patch, you will be able to more predictably block the chosen resource combination, with the added checkbox.

Also, the location field is propagated to `resource.booking` records, and synced from there to `calendar.event` if needed. This way, you can alter the location before sending the portal invitation.

@Tecnativa TT30987
@yajo yajo force-pushed the 13.0-resource_booking-imp_multiplier branch from c7a4ddf to 1cd849d Compare July 23, 2021 13:03
Jairo Llopis added 2 commits July 26, 2021 10:38
The filter wasn't working fine due to the `auto_join=True` set in `meeting_id`. It was never displaying pending bookings.

Besides, it wasn't necessary to keep it as a field because it was displayed nowhere and the search could be done directly in the view. This way, there's less python code to maintain and we disable the possibility of having a negative domain, which enters doomed scenarios when x2many fields are involved (see odoo/odoo#43957).

@Tecnativa TT30987
Adding `.with_context(exclude_public_holidays=True)` in needed places to let `hr_holidays_public` do its magic and never allow allocating a booking during a public holidays when that module is properly installed and configured.

@Tecnativa TT30987
@yajo yajo changed the title [IMP] resource_booking: use duration field instead of stop [IMP+FIX] resource_booking: duration, location, involves me, hr_holidays_public Jul 26, 2021
@yajo
Copy link
Member Author

yajo commented Jul 26, 2021

Updated description to reflect current state of the PR, which has 4 different feature sets. Ready to review/merge.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still missing the name field on the resource.booking, needed for setting the meeting topic and to be transferred to the calendar.event.

@yajo
Copy link
Member Author

yajo commented Jul 26, 2021

This is still missing the name field on the resource.booking, needed for setting the meeting topic and to be transferred to the calendar.event.

Currently the name is computed based on the date, requester and type, and it's propagated to the calendar meeting.

That's on purpose because originally having to add a name would be uncomfortable and unnecessary, because basically every booking of the same type has the same purpose. Also, when placing a booking from e-commerce, we don't want the customer to have to write a name; that adds no value.

I can add the name field and make it optional. Then, if it's empty, I can compute the display_name to the same value name has now. Sounds good?

@pedrobaeza
Copy link
Member

pedrobaeza commented Jul 26, 2021

I want to add a free text. For example: "Meeting about module X". And the title of the calendar.event should be that one, and in the portal that should be also. You tell me the technical specifications for that.

@yajo
Copy link
Member Author

yajo commented Jul 26, 2021

Ok, but I mean that we need to make that optional. We can't require the name field to be filled, or we'll break the original purpose of the module.

@pedrobaeza
Copy link
Member

It can be optional indeed.

- Allow users to optionally define a name for the resource booking.
- Display that name in portal if set.
- Sync it with meeting name when creating it.

@Tecnativa TT30987
@yajo yajo requested a review from pedrobaeza July 27, 2021 08:58
@yajo
Copy link
Member Author

yajo commented Jul 27, 2021

Custom optional name added (see last video on description).

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 13.0-ocabot-merge-pr-34-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@OCA-git-bot OCA-git-bot merged commit dc05451 into OCA:13.0 Jul 27, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 8996fb0. Thanks a lot for contributing to OCA. ❤️

@yajo yajo deleted the 13.0-resource_booking-imp_multiplier branch July 28, 2021 06:10
yajo pushed a commit to Tecnativa/calendar that referenced this pull request Jul 29, 2021
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
njeudy pushed a commit to nj-0k-io/calendar that referenced this pull request Jan 19, 2022
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
pedrobaeza pushed a commit to Tecnativa/calendar that referenced this pull request Oct 24, 2022
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
victoralmau pushed a commit to Tecnativa/calendar that referenced this pull request Mar 3, 2023
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
victoralmau pushed a commit to Tecnativa/calendar that referenced this pull request Mar 6, 2023
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
pedrobaeza pushed a commit to Tecnativa/calendar that referenced this pull request Mar 25, 2023
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
victoralmau pushed a commit to Tecnativa/calendar that referenced this pull request Mar 11, 2024
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
isaaccf pushed a commit to isaaccf/calendar that referenced this pull request Sep 5, 2024
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
victoralmau pushed a commit to Tecnativa/calendar that referenced this pull request Nov 11, 2024
Missing part from OCA#34:

- Display booking duration and location on portal, even on pending state.
- Improve portal test to contemplate new behaviors.

@Tecnativa TT31250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants