Skip to content

[ADD] website_sale_exception_checkout: check sale exceptions before payment - #496

Open
JrAdhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-t-75453-jr
Open

JrAdhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-t-75453-jr

Conversation

@JrAdhoc

@JrAdhoc JrAdhoc commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Tarea: https://www.adhoc.inc/odoo/project.task/75453

New bridge module between website_sale and sale_exception (auto_install).

Problem. sale_exception checks the rules when the order is confirmed. On the eCommerce that happens after the payment: the transaction is paid and the order stays as a quotation. With the OCA base_exception refactor (OCA/server-tools#3729, still open on 19.0) the error is also raised to the customer.

Change.

  • exception.rule: new "Check on eCommerce" flag and an eCommerce message (translatable HTML) shown only to the customer. If empty, a generic message is shown.
  • Orders with a website only evaluate the flagged rules, at any moment (checkout, confirmation after payment, manual confirmation, later edits). Orders without website keep evaluating every rule.
  • /shop/payment: the flagged rules are added to _get_shop_payment_errors, so the native template hides the payment form and button and shows the error banner. A "Back to cart" button is added.
  • _check_cart_is_ready_to_be_paid raises the same error: covers /shop/payment/transaction and express checkout.
  • The rules are evaluated with _get_exceptions (no raise, nothing stored on the order), so it works before and after the OCA refactor.

Notes.

  • The name avoids the existing website_sale_exception module of ingadhoc/sale.
  • This PR stays open until the OCA refactor is merged on 19.0.

@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@JrAdhoc JrAdhoc changed the title [WIP] [ADD] website_sale_exception_checkout: check sale exceptions before payment [ADD] website_sale_exception_checkout: check sale exceptions before payment Oct 9, 2026
…ayment

Bridge between website_sale and sale_exception (auto_install).

- exception.rule: new "Check on eCommerce" flag and an eCommerce message
  (translatable HTML) shown to the customer.
- Orders with a website only evaluate the flagged rules, at any moment
  (checkout, confirmation after payment, manual confirmation, later
  edits). Orders without website keep evaluating every rule.
- /shop/payment: flagged rules are evaluated through
  _get_shop_payment_errors, so the payment form and button are hidden and
  an error banner is shown, with a "Back to cart" button.
- _check_cart_is_ready_to_be_paid raises the same error, which covers
  /shop/payment/transaction and express checkout.
- Exceptions are evaluated with _get_exceptions (no raise, nothing stored
  on the order), so it works before and after the OCA base_exception
  refactor.

Change note:
Las excepciones de venta marcadas para el e-commerce se validan en el
último paso del checkout, antes de pagar. Si alguna aplica, el cliente no
puede pagar, ve el mensaje configurado en la regla (o uno genérico) y
puede volver al carrito. En las órdenes del e-commerce las reglas sin
marcar ya no se evalúan, así una orden pagada no queda en presupuesto por
una regla pensada para el backend.

This branch has not been deployed

No deployments
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.

2 participants