[IMP] website_sale_aplicoop: disable standard website_sale cart — hide header cart, remove add-to-cart, redirect cart routes to /eskaera

This commit is contained in:
snt 2026-05-19 17:10:29 +02:00 committed by GitHub Copilot
parent 3ca90578ae
commit 8f7eca45b8
2 changed files with 74 additions and 5 deletions

View file

@ -141,3 +141,49 @@ This module was inspired by the original **Aplicoop** project:
* Original creators: Ekaitz Mendiluze, Joseba Legarreta, and other contributors
The original Aplicoop project served as a pioneering solution for collaborative consumption group orders, and this module brings its functionality to the modern Odoo platform.
Notes - Shop behaves as a simple catalog
=========================================
Starting with the recent update, this module converts the default Odoo
``/shop`` storefront into a simple product catalog (no standard ``website_sale``
shopping cart). The change is intentional for sites that use the Aplicoop
"eskaera" flow as the single shopping experience.
What the module does
---------------------
- Hides the standard header cart link and badge.
- Removes the "Add to cart" quick-add area from product listings.
- Redirects standard cart endpoints to the group-order flow (``/eskaera``):
``/shop/cart``, ``/shop/cart/update``, ``/shop/cart/update_json``, ``/shop/cart_quantity``.
Files involved
--------------
- ``views/website_sale_disable_cart.xml`` — templates that hide/remove cart UI
- ``controllers/website_sale.py`` — routes that redirect cart endpoints to ``/eskaera``
- ``__manifest__.py`` — includes the new view file
How to apply or revert
-----------------------
To apply the change (already applied when the module is installed/updated):
::
docker-compose run --rm odoo odoo -d odoo -u website_sale_aplicoop --stop-after-init
docker-compose up -d
To revert back to the standard ``website_sale`` behaviour:
1. Remove ``views/website_sale_disable_cart.xml`` from the ``data`` section in
``__manifest__.py``.
2. Update the module:
::
docker-compose run --rm odoo odoo -d odoo -u website_sale_aplicoop --stop-after-init
Note: Reverting may expose standard cart UI and routes; ensure your site
content and workflows are adapted accordingly.