Skip to content

[16.0][FIX] rental_base_extension: rental service button on multi-variant products#886

Open
eantones wants to merge 2 commits into16.0from
16.0-fix-rental_base_extension-rental_service_button_multivariant
Open

[16.0][FIX] rental_base_extension: rental service button on multi-variant products#886
eantones wants to merge 2 commits into16.0from
16.0-fix-rental_base_extension-rental_service_button_multivariant

Conversation

@eantones
Copy link
Copy Markdown
Member

@eantones eantones commented Apr 2, 2026

Summary

  • Show the "Create Rental Services" button on product templates with multiple variants, allowing batch creation of rental services for all variants at once
  • Restrict the "Can be Rented" checkbox and "Rentals" section to storable products only (hide for consumables and services)
  • Single-variant products keep the original wizard; multi-variant products get a new batch action

Test plan

  • Open an existing storable product with variants (e.g. "Regulador Rover S25"), enable "Es pot llogar", save, and verify the "Create Rental Services" button appears in the Rentals section
  • Click the button and verify rental services are created for all variants
  • Verify the button does NOT appear on consumable or service products
  • Verify single-variant storable products still show the original "Create Rental Service" wizard

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 31.57895% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.24%. Comparing base (20d034b) to head (94b0096).

Files with missing lines Patch % Lines
rental_base_extension/models/product.py 27.77% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             16.0     #886      +/-   ##
==========================================
- Coverage   44.28%   44.24%   -0.04%     
==========================================
  Files         317      318       +1     
  Lines        6294     6313      +19     
  Branches     1000     1003       +3     
==========================================
+ Hits         2787     2793       +6     
- Misses       3486     3499      +13     
  Partials       21       21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@eantones eantones force-pushed the 16.0-fix-rental_base_extension-rental_service_button_multivariant branch from 631a5e2 to 0e934ef Compare April 7, 2026 11:20
eantones added 2 commits April 7, 2026 13:21
…ant products

The "Create Rental Service" button and the "Rentals" section were hidden
on product templates with more than one variant, preventing users from
creating rental services for existing products with variants (e.g.
regulators with sizes, wetsuits with sizes).

Now the "Rentals" section is visible for all storable products regardless
of variant count. For single-variant products, the original wizard is
used. For multi-variant products, a new button creates rental services
for all variants at once.

Also restrict the "Can be Rented" checkbox and the "Rentals" section to
storable products only (type == 'product'), hiding them for consumables
and services.
…tion

Add Catalan and Spanish translations for the new strings introduced
by the multi-variant rental service creation:

- "Create Rental Services" button label
- "Created Rental Services" action window name
- "All variants already have a rental service." error message

Reuse the parent module's "Rental of a {}" and "RENT-{}" strings
(via .format()) so we share the existing translation keys with
sale_rental's wizard.

Update rental_base_extension.pot with the new entries.
@eantones eantones force-pushed the 16.0-fix-rental_base_extension-rental_service_button_multivariant branch from 0e934ef to 94b0096 Compare April 7, 2026 11:22
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.

1 participant