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

[16.0][IMP] sale_resource_booking: use type as product_attribute_value #3561

Open
wants to merge 11 commits into
base: 16.0
Choose a base branch
from

Conversation

norlinhenrik
Copy link

@norlinhenrik norlinhenrik commented Feb 2, 2025

PURPOSE

Use a resource booking type as a product attribute value.

  1. Enable product variants in the settings.
  2. Create a product attribute value (Resource Bookings - Configuration - Product Attributes).
  3. Create a resource booking type, and use the field Product Attribute Value to connect the two records.
  4. Create a product template. Use the Attributes & Variants tab to set the attribute & attribute value of the booking type.
  5. Automatic: The product variant has the resource booking type.

A migration script updates product.product with resource_booking_type_id and resource_booking_type_combination_rel_id.

NEW MENUITEMS under Resource Bookings - Configuration

  • Products - Search filter: Has booking type - Form view: readonly the booking type if there are multiple variants
  • Product Variants - List view: button to BOOK if the booking type is set - Form view: button to see Bookings
  • Product Attributes - Form view: see (readonly) the booking type of each attribute value

NEW FIELDS & ACTIONS

product.attribute.value

  • resource_booking_type_ids (many2many)

product.product

  • resource_booking_type_id
  • resource_booking_type_combination_rel_id
  • resource_booking_count
  • resource_booking_ids (one2many)
  • def action_view_resource_booking (different behavior if resource_booking_timeline is installed)
  • def _set_resource_booking_type_id

product.template

  • def _compute_resource_booking_type_and_combination_rel
  • def _inverse_resource_booking_type_and_combination_rel

resource.booking.type

  • product_ids (one2many)
  • product_attribute_value_ids (many2many)
  • def _check_unique_product_attribute_value_ids

Jairo Llopis and others added 11 commits February 2, 2025 12:05
This module extends the functionality of sale and resource bookings to support
creating pending resource bookings automatically when confirming a sale order
and to allow you to generate those sale orders easily from a resource booking
type.

@Tecnativa TT28202
- Set `resource.booking` new `combination_auto_assign` field depending on `product.template`'s `resource_booking_type_combination_rel_id`.
- Adapt tests.
- The rest is normal migration stuff.

@Tecnativa TT31324
[FIX] sale_resource_booking: Migration to 16.0
Enable product variants in the settings.
Create a product attribute value (Resource Bookings - Configuration - Product Attributes).
Create a resource booking type, and use the field Product Attribute Value to connect the two records.
Create a product template. Use the Attributes & Variants tab to set the attribute & attribute value of the booking type.
Automatic: The product variant has the resource booking type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants