Skip to content

Conversation

@pilarvargas-tecnativa
Copy link
Contributor

@pilarvargas-tecnativa pilarvargas-tecnativa commented Oct 29, 2025

This migration only ports the cart expiration logic to v18 and deliberately
omits the frontend countdown timer in the cart.

The countdown timer has not been migrated because there is no underlying
reservation mechanism implemented in this module. Without a functional
reservation of seats, resources, or stock at quotation time, displaying a
timer in the cart would provide no real effect beyond visual urgency.

A countdown would only make sense in scenarios where the draft order
actually holds a temporary reservation (e.g., event seat allocation,
booking/rental slots, or other custom reservation flows). Since none of
those use cases are part of the current module and cannot be properly
validated here, the timer has been intentionally left out of the v18
migration.

The functional value of the module in standard deployments comes from the
automatic cancellation of stale carts through the cron job, which remains
fully supported and migrated. This keeps the module lean, predictable, and
focused on its core purpose.

The structure of the module remains open for future contributions, so
anyone needing a countdown UI in combination with a reservation mechanism
can reintroduce or adapt that part as required for their specific use case.

@Tecnativa TT58474

@carlos-lopez-tecnativa @CarlosRoca13 please review

ivantodorovich and others added 15 commits October 29, 2025 17:57
Module that allows to automatically cancel carts without
activity after a configurable time.
In a typical website flow, quotations are moved to sent state when
a payment by Wire transfer is chosen.

In this scenario, the quotation shouldn't be automatically cancelled.

It's up to the salesman to determine when a sent quotation is expired,
as technically speaking this isn't just a cart anymore.
[Fix] Use new payment.payment_provider_demo for test cases

[Fix] Change acquirer_id to provider_id for test cases
Currently translated at 100.0% (14 of 14 strings)

Translation: e-commerce-16.0/e-commerce-16.0-website_sale_cart_expire
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-16-0/e-commerce-16-0-website_sale_cart_expire/es/
Before this commit, there are an issue the method raise
an error if transaction_ids.last_state_change was false.
It's possible for last_state_change to be false as a result
of migrating data from a past Odoo DB version.
Currently translated at 100.0% (14 of 14 strings)

Translation: e-commerce-16.0/e-commerce-16.0-website_sale_cart_expire
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-16-0/e-commerce-16-0-website_sale_cart_expire/it/
@pedrobaeza
Copy link
Member

/ocabot migration website_sale_cart_expire

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Oct 29, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 29, 2025
40 tasks
@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 18.0-mig-website_sale_cart_expire branch from 18b5c8c to 1e0678c Compare October 30, 2025 11:00
@pilarvargas-tecnativa pilarvargas-tecnativa force-pushed the 18.0-mig-website_sale_cart_expire branch 2 times, most recently from 05225bd to 5a33069 Compare October 30, 2025 16:58
Copy link
Contributor

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor non-blocking comment.
I think it would be great to add an option to notify the user when the cart has expired or is about to expire, because I waited for the time to run out but, as a user, I didn’t receive any notification. Also, while the cron hasn’t been executed yet, my cart remains unchanged, but once the cron runs, I only see my cart empty.

This migration only ports the cart expiration logic to v18 and deliberately
omits the frontend countdown timer in the cart.

The countdown timer has not been migrated because there is no underlying
reservation mechanism implemented in this module. Without a functional
reservation of seats, resources, or stock at quotation time, displaying a
timer in the cart would provide no real effect beyond visual urgency.

A countdown would only make sense in scenarios where the draft order
actually holds a temporary reservation (e.g., event seat allocation,
booking/rental slots, or other custom reservation flows). Since none of
those use cases are part of the current module and cannot be properly
validated here, the timer has been intentionally left out of the v18
migration.

The functional value of the module in standard deployments comes from the
automatic cancellation of stale carts through the cron job, which remains
fully supported and migrated. This keeps the module lean, predictable, and
focused on its core purpose.

The structure of the module remains open for future contributions, so
anyone needing a countdown UI in combination with a reservation mechanism
can reintroduce or adapt that part as required for their specific use case.

TT58474
@pilarvargas-tecnativa
Copy link
Contributor Author

@eduezerouali-tecnativa please review

Copy link
Contributor

@eduezerouali-tecnativa eduezerouali-tecnativa left a comment

Choose a reason for hiding this comment

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

Code review + runboat

@pedrobaeza
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 18.0-ocabot-merge-pr-1130-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 48c910c into OCA:18.0 Nov 21, 2025
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@carlos-lopez-tecnativa carlos-lopez-tecnativa deleted the 18.0-mig-website_sale_cart_expire branch November 21, 2025 16:09
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.