Skip to content

[18.0][MIG] sale_rental: Migration to 18.0#71

Open
chaule97 wants to merge 58 commits intoOCA:18.0from
chaule97:18.0-mig-sale_rental
Open

[18.0][MIG] sale_rental: Migration to 18.0#71
chaule97 wants to merge 58 commits intoOCA:18.0from
chaule97:18.0-mig-sale_rental

Conversation

@chaule97
Copy link
Copy Markdown

@chaule97 chaule97 commented Nov 13, 2025

Alexis de Lattre and others added 30 commits October 13, 2025 14:14
Replace openerp by odoo in import declarations
Convert readme to new subdir format
the creation of the stock location for rental respects the translations
Currently translated at 85.4% (88 of 103 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
Currently translated at 9.7% (10 of 103 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/pt/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_rental
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_rental/
No more need to add users to the packaging group
View of rental group is now possible on product.template form view
Standard migration + add some tests
@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch from 55b725b to 19a48b6 Compare November 14, 2025 04:31
@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch 2 times, most recently from a68a1c3 to 5c0420c Compare December 9, 2025 05:36
@kaynnan
Copy link
Copy Markdown

kaynnan commented Dec 28, 2025

@chaule97 Could you please do a rebase?

@chaule97
Copy link
Copy Markdown
Author

chaule97 commented Dec 29, 2025

Could you please do a rebase?

the PR is waiting for PR OCA/sale-workflow#3505, so the first failing test is expected. It's no merge conflict

@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch 3 times, most recently from bebf195 to 7f924f8 Compare January 19, 2026 11:44
Copy link
Copy Markdown

@remi-filament remi-filament left a comment

Choose a reason for hiding this comment

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

Hi @chaule97 Thank you for migrating this module.
Tested on runboat : rental_qty is not displayed on sale order line and is not set raising a constraint error when checking that product_uom_id = rental_qty * number_of_days

Image

@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch from 7f924f8 to 9214809 Compare February 25, 2026 05:06
@chaule97
Copy link
Copy Markdown
Author

Hi @chaule97 Thank you for migrating this module. Tested on runboat : rental_qty is not displayed on sale order line and is not set raising a constraint error when checking that product_uom_id = rental_qty * number_of_days
Image

Can you check again?

@remi-filament
Copy link
Copy Markdown

Hi @chaule97 Thank you for migrating this module. Tested on runboat : rental_qty is not displayed on sale order line and is not set raising a constraint error when checking that product_uom_id = rental_qty * number_of_days
Image

Can you check again?

Hi @chaule97 thank you for looking into iti.
I still have the same behavior : (Pricing hint is not updated, rental quantity not shown (so cannot change from 0), quantity shown instead which is not taking into account number of days * rental quantity
image

Leading to Validation Error when trying to create the sale order :
image

@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch 2 times, most recently from 8d357cf to a28e7c0 Compare February 25, 2026 08:36
@remi-filament
Copy link
Copy Markdown

Thanks @chaule97 now that part is not raising errors anymore and you can properly set rental quantity.

I spotted another issue with version 18.0 of this module : it does not generate return picking at the end of rental. This is related to how routes/rules are applied in version 18.0, push rules are not automatically triggered anymore.

Also, although less important, UI/UX of this module should be reworked to get views coherent with the other modules (for instance product form views have been kept from old version but have not been adapted to newer versions).
I made a lot of comments on these topics on version 17.0 migration PR : #52 (review)

FYI, I have made a simplified version of this module for version 18.0 for a customer who had simpler requirements than what this module covers (no need for autocompute of duration / quantity, no need for rental prices and periods, etc.) here : https://github.com/lefilament/vertical-rental/tree/18.0-mecaoctet (this branch is in production for that customer)

In particular, you may want to have a look here on how to force to apply push rule for generating return picking : https://github.com/lefilament/vertical-rental/blob/ac1537c29cae3cbe0e62af38da1a14a26de3ecf5/sale_rental/models/sale_order_line.py#L183-L184

Also you would need to fix the failing tests

@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch from a28e7c0 to a7dc95b Compare February 25, 2026 09:05
@chaule97
Copy link
Copy Markdown
Author

Hi @chaule97 Thank you for migrating this module. Tested on runboat : rental_qty is not displayed on sale order line and is not set raising a constraint error when checking that product_uom_id = rental_qty * number_of_days
Image

Can you check again?

Hi @chaule97 thank you for looking into iti. I still have the same behavior : (Pricing hint is not updated, rental quantity not shown (so cannot change from 0), quantity shown instead which is not taking into account number of days * rental quantity image

Leading to Validation Error when trying to create the sale order : image

Sorry, I forgot about my fix in version 16.0, can you check again?

@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch 2 times, most recently from 4f60698 to 69acbd8 Compare February 25, 2026 09:55
@chaule97 chaule97 force-pushed the 18.0-mig-sale_rental branch from 69acbd8 to 01b26bd Compare February 26, 2026 09:19
Copy link
Copy Markdown

@Kev-Roche Kev-Roche left a comment

Choose a reason for hiding this comment

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

Thank you for this migration.

I do not understand the benefit of adding "rental period" and "product rental pricing" logic. Using pricelists and configuring some units of measure seems to be enough. Maybe I'm missing something... Maybe, if "product rental pricing" and "rental period" have a clear use case, putting them in a separate module since they are not required for this migration.

IMHO, this module is already complex, it would be better to split new features that are not relevant to all projects into separate modules, as I did in v16 here: #36 and #37 (I will migrate them soon).

Also, if we introduce new features, we need tests for them.

Comment on lines +23 to +26
rental_pricing_ids = fields.One2many(
"product.rental.pricing", "product_id", string="Rental Pricings"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why introducing a new model "product.rental.pricing" and not using the existing pricelist.item with unit of mesure logic ?

Comment on lines +32 to +37
<menuitem
id="menu_rental_report_dashboard"
name="Rental Report"
parent="sale.sale_order_menu"
action="action_rental_report_wizard"
/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is disturbing to see this menu between quotations and sales. Maybe put it in sale analysis menu or at least add a sequence to put it under locations within the same menu.

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.