Skip to content

[16.0][ADD] product_catalog_sale_rental: bridge catalog with rental orders#868

Merged
eantones merged 1 commit into16.0from
16.0-add-product_catalog_sale_rental
Apr 2, 2026
Merged

[16.0][ADD] product_catalog_sale_rental: bridge catalog with rental orders#868
eantones merged 1 commit into16.0from
16.0-add-product_catalog_sale_rental

Conversation

@eantones
Copy link
Copy Markdown
Member

Summary

  • New glue module between product_catalog_sale and sale_rental so that products added from the catalog create proper rental lines with rental_type, rental_qty, dates and computed product_uom_qty
  • Adds readonly=False to start_date/end_date on sale.order.line to work around a circular dependency issue in sale_start_end_dates computes during programmatic create()
  • Includes Catalan and Spanish translations for the module and for the untranslated parent modules (product_catalog, product_catalog_sale)

Test plan

  • Install module on a database with product_catalog_sale and sale_rental
  • Configure a rental service product with rented_product_id
  • Create a sale order with default start/end dates, open catalog, add the rental product — verify line has correct rental_type, rental_qty, dates and product_uom_qty = qty × days
  • Increase/decrease quantity via catalog — verify rental_qty and product_uom_qty update
  • Remove rental product via catalog (Eliminar) — verify line is deleted
  • Add a regular (non-rental) product via catalog — verify no interference (no dates, no rental fields)
  • Add a product manually via "Añadir un producto" — verify standard behavior unchanged
  • Try adding rental product without dates set on order — verify UserError is shown
  • Mixed order: add both rental and regular products from catalog — verify both coexist correctly
  • Verify translations appear in Catalan/Spanish UI

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 27.45098% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.16%. Comparing base (419ffde) to head (65210b7).
⚠️ Report is 7 commits behind head on 16.0.

Files with missing lines Patch % Lines
product_catalog_sale_rental/models/sale_order.py 24.48% 37 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             16.0     #868      +/-   ##
==========================================
- Coverage   44.30%   44.16%   -0.14%     
==========================================
  Files         313      316       +3     
  Lines        6230     6281      +51     
  Branches      989     1000      +11     
==========================================
+ Hits         2760     2774      +14     
- Misses       3449     3486      +37     
  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-add-product_catalog_sale_rental branch 2 times, most recently from 0ba8009 to acbac0e Compare March 24, 2026 14:57
Bridge between product_catalog_sale and sale_rental so that
products added from the catalog on a rental order create proper
rental lines with rental_type, rental_qty, start/end dates and
the correct product_uom_qty (rental_qty × number_of_days).

The start_date and end_date fields on sale.order.line are redefined
with readonly=False to allow programmatic writes during create(),
working around a circular dependency issue in the upstream
sale_start_end_dates computes that prevents dates from being
auto-filled when lines are created outside the form view.
@eantones eantones force-pushed the 16.0-add-product_catalog_sale_rental branch from acbac0e to 65210b7 Compare March 24, 2026 15:03
@eantones eantones merged commit 20d034b into 16.0 Apr 2, 2026
11 of 13 checks passed
@eantones eantones deleted the 16.0-add-product_catalog_sale_rental branch April 2, 2026 14:32
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