Commit graph

123 commits

Author SHA1 Message Date
GitHub Copilot
b0dc189708 traducciones 2026-05-21 16:14:04 +02:00
GitHub Copilot
876e7b1fbf traducciones 2026-05-21 15:15:30 +02:00
GitHub Copilot
d3d1231d29 disable load in cart portal buttons 2026-05-21 13:50:50 +02:00
GitHub Copilot
f983d71ea3 [FIX] website_sale_aplicoop: fix account.tax access error and duplicate home-delivery handler
Add sudo() to pricelist_item and fiscal position fallback in _get_pricing_info
so portal users can price the delivery product without triggering an AccessError
on account.tax. Remove the redundant #home-delivery-btn click handler from
website_sale.js — home_delivery.js already owns that button via
bindShopHomeDeliveryButton(), which manages the active class and localStorage cart.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 18:20:02 +02:00
GitHub Copilot
27097004fb [FIX] website_sale_aplicoop: wire home delivery preference through all save flows
Three bugs prevented home_delivery from reaching sale.order:

1. #home-delivery-btn (shop sidebar) had no JS handler — clicking it did
   nothing. Now it toggles active state and persists choice to sessionStorage.

2. _executeSaveCartAsDraft (Save Cart button) never included is_delivery in
   the request body. Now reads the toggle button state (or the page-level
   data-home-delivery-enabled fallback) and sends is_delivery correctly.

3. #home-delivery-checkbox on checkout page was unchecked by default and
   always shown. Now it is pre-checked when group_order.home_delivery is
   True, wrapped in t-if to hide it when delivery is not configured, and
   synced bidirectionally with sessionStorage so the shop-page toggle state
   carries over to checkout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:57:07 +02:00
GitHub Copilot
a1899483c5 [TEST] website_sale_aplicoop: add tests for home_delivery computed field
- New test_home_delivery.py: verifies group.order.home_delivery derives
  from delivery_product_id (compute), and that sale.order.home_delivery
  is set correctly through _get_effective_delivery_context
- Fix test_save_order_endpoints: replace home_delivery=True (now ignored
  on computed field) with delivery_product_id to enable delivery
- Fix test_phase3_confirm_eskaera: same fix for integration test setUp

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:49:50 +02:00
GitHub Copilot
9d614ed79e [FIX] website_sale_aplicoop: auto-derive home_delivery from delivery_product_id
Make group.order.home_delivery a computed stored field that is True
whenever delivery_product_id is set, eliminating the manual checkbox
that could be forgotten. This fixes sale.order.home_delivery not being
set when the delivery product was configured but the boolean was left
unchecked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:37:33 +02:00
GitHub Copilot
fb1efb0474 [IMP] website_sale_aplicoop: mostrar día y horario completo en pickup slots
Antes: si el slot tenía label, solo se mostraba el label (sin día ni hora).
Ahora: siempre se muestra día + rango horario (09:00–13:00), con el label
entre paréntesis como información adicional opcional.

Aplicado en eskaera_order_card_meta (tarjeta compacta) y en la vista
detalle de la tienda (group_order.pickup_slot_ids).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:28:39 +02:00
GitHub Copilot
91301fc271 [FIX] website_sale_aplicoop: corregir error QWeb pickup_slot_ids|length
El operador | en expresiones t-if de QWeb es el OR bitwise de Python,
no un filtro Jinja2. Como 'length' no existe en el contexto QWeb, evaluaba
recordset | None y lanzaba TypeError. Simplificado a solo pickup_slot_ids
(recordset vacío ya es falsy en Python).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:21:57 +02:00
GitHub Copilot
b14a6f84ed [IMP] website_sale_aplicoop: mostrar franjas de recogida en formulario group.order
- Añadir reglas de acceso para group.order.slot en ir.model.access.csv
- Añadir pestaña "Pickup Slots" en el formulario de group.order con lista
  editable (handle de secuencia, día, etiqueta, hora inicio/fin, activo)
- Corregir valores del campo weekday: de dígitos numéricos a nombres de día
  (Monday...Sunday) para mejor usabilidad

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:06:38 +02:00
GitHub Copilot
eb81e7db6a [IMP] website_sale_aplicoop: ajustar CSS tarjeta producto — placeholder y compresión móvil
- product-img-cover: max-height → height fija para que placeholder y imagen
  real ocupen exactamente el mismo bloque (120px/90px/60px según breakpoint)
- product-img-placeholder: reemplaza SVG inline por flex centrado, más limpio
- Reducir padding/márgenes generales en card-body, title, supplier, tags y precio
- Dos breakpoints responsivos: ≤768px (tablet, imagen 90px) y ≤480px (móvil,
  imagen 60px, fuentes y márgenes mínimos)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 17:02:33 +02:00
GitHub Copilot
a4410b9b9e [DOC] actualizar y sincronizar documentación de todos los addons
- README.md: reescrito con tabla completa de los 14 addons (6 OCA + 8 custom),
  versiones actuales, árbol de dependencias y comandos de desarrollo
- docs/README.md: simplificado a índice limpio, eliminadas referencias rotas
- website_sale_aplicoop/CHANGELOG.md: añadidas versiones 1.7.0, 1.8.0 y 1.9.0
  con los cambios agrupados por temática desde el último registro (1.6.0)
- website_sale_aplicoop/README_DEV.md: reescrito para reflejar v1.9.0 —
  modelos actuales (group.order.slot), controladores /eskaera, catálogo
  whitelist/blacklist, lazy loading, crons y árbol de dependencias

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 16:27:17 +02:00
GitHub Copilot
91cfb9e137 [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
snt
a997331c2d lint: fix linter warnings (log exceptions, disable attribute-string-redundant, suppress C901 where necessary) 2026-05-20 16:05:14 +02:00
snt
f8ef927a9e [IMP] website_sale_aplicoop: add sequence field to product.category for web ordering
- Add sequence field (default 10) to product.category with _order = "sequence, name"
- Inherit product.category tree view to add drag-handle widget
- Sort category hierarchy and available categories by sequence in controller
- Migration 18.0.1.9.0: add sequence column to product_category table
- Bump version to 18.0.1.9.0
2026-05-20 16:05:14 +02:00
snt
8f7eca45b8 [IMP] website_sale_aplicoop: disable standard website_sale cart — hide header cart, remove add-to-cart, redirect cart routes to /eskaera 2026-05-20 16:05:14 +02:00
snt
3ca90578ae [IMP] website_sale_aplicoop: Validar disponibilidad de productos al cargar órdenes históricas
- Backend: Agregar método _validate_items_for_group_order() para validar que los productos históricos sigan siendo disponibles en la orden de grupo actual
- Backend: Modificar load_order_from_history() para filtrar solo items disponibles antes de pasar al template
- Backend: Generar mensaje de aviso traducido cuando hay productos no disponibles
- Template: Pasar información de productos no disponibles y warnings al JavaScript
- Frontend: Mostrar notificación de advertencia si hubo productos excluidos durante la carga histórica
- Notas: Esto evita cargar productos que ya no existen en la orden actual debido a cambios en categorías, proveedores o listas negras
2026-05-20 16:05:14 +02:00
snt
1d4971c803 [IMP] website_sale_aplicoop: mejora card producto (placeholder, responsive móvil, accesibilidad y estilo profesional) 2026-05-20 16:05:14 +02:00
snt
828278573d Fix stock picking batch date and does not split batchs by consumer group 2026-05-20 16:05:14 +02:00
snt
b73f031dfb [FIX] website_sale_aplicoop: renombrar clear_cart a eskaera_clear_cart
Evita conflicto de tipo de ruta con el método clear_cart() del padre
WebsiteSale de Odoo 18 (type=json). Misma URL /eskaera/clear-cart,
solo cambia el nombre del método Python.

También añade noqa C901 en save_eskaera_draft (complejidad preexistente).
2026-05-20 16:05:14 +02:00
snt
ce393b6034 [FIX] TestConfirmEskaera_Integration: limpieza de decoradores @patch y corrección de bugs
- Convertir 4 tests de decorador @patch a context manager 'with patch(...)' para evitar RuntimeError en LocalProxy de Werkzeug
- Corregir patrón env(user=..., context=dict(...)) en Odoo 18 (sin .with_context())
- Agregar website real al mock para integración con helpers de pricing (_get_pricing_info)
- Añadir pickup_date en fixture de existing_order para que _find_recent_draft_order localice correctamente
- BUGFIX: Agregar (5,) a order_line para limpiar líneas previas al actualizar pedido existente

Resultado: 0 failed, 0 errors de 4 tests en Docker para TestConfirmEskaera_Integration

BREAKING: _create_or_update_sale_order ahora limpia las líneas anteriores con (5,) antes de asignar las nuevas cuando se actualiza un pedido existente. Comportamiento previo (duplicación de líneas) era un bug.
2026-04-08 17:26:57 +02:00
snt
e9809b90e9 [FIX] website_sale_aplicoop: fix home delivery draft flow 2026-04-08 00:07:43 +02:00
snt
135967019e [ADD] website_sale_aplicoop: botón limpiar carrito en sidebar
Añade botón 'Clear Cart' (fa-trash) en el header y footer del sidebar
del carrito en la página de lista de productos.

Cambios:
- views/website_templates.xml: botón clear-cart-btn en card-header y
  clear-cart-btn-footer en card-footer del sidebar
- controllers/website_sale.py: nuevo endpoint POST /eskaera/clear-cart
  que cancela el sale.order borrador del usuario si existe
- static/src/js/website_sale.js: método _clearCart(), listeners para
  ambos botones (header + footer)
- models/js_translations.py: nuevas cadenas clear_cart, clear_cart_confirm,
  cart_cleared, draft_cancelled
- i18n/es.po, i18n/eu.po: traducciones ES y EU de los nuevos labels
2026-04-07 23:50:30 +02:00
snt
0eb7957a70 [IMP] website_sale_aplicoop: remove redundant string= from Boolean fields (W8113) 2026-04-07 23:39:49 +02:00
snt
26bfa028d1 [IMP] website_sale_aplicoop: use virtual_available for stock check instead of qty_available
Use forecasted quantity (virtual_available) instead of on-hand quantity
(qty_available) for out-of-stock and low-stock calculations, so pending
incoming/outgoing moves are taken into account.
2026-04-07 23:39:00 +02:00
snt
39b9f887a9 [FIX] website_sale_aplicoop: filtrar pedidos por grupo de consumo en controller eskaera_list y eskaera_shop 2026-04-07 23:19:30 +02:00
snt
5975e4713a [FIX] website_sale_aplicoop: añadir guardia user.share a rule_group_order_company_read 2026-04-07 23:12:55 +02:00
snt
6a748ca308 [FIX] website_sale_aplicoop: restringir acceso portal por grupo de consumo 2026-04-07 22:50:22 +02:00
snt
7d11a95344 [FIX] website_sale_aplicoop: freeze pickup dates on cron confirm 2026-03-31 20:07:50 +02:00
snt
331a2e8944 [FIX] website_sale_aplicoop: harden group order cron 2026-03-31 19:36:20 +02:00
snt
813c8071d9 [I18N] website_sale_aplicoop: remove legacy week draft strings 2026-03-31 19:07:43 +02:00
snt
ff87243476 [FIX] website_sale_aplicoop: avoid _() calls in QWeb labels 2026-03-31 16:25:48 +02:00
snt
c17bd7eddd [FIX] website_sale_aplicoop: translate cart labels safely 2026-03-31 16:18:40 +02:00
snt
603e6b6aa1 [I18N] website_sale_aplicoop: add missing checkout translations 2026-03-31 16:07:15 +02:00
snt
2caf7673d7 [FIX] website_sale_aplicoop: move cart before products 2026-03-31 16:05:51 +02:00
snt
12d434d4c7 [IMP] website_sale_aplicoop: simplify cutoff guard in _confirm_linked_sale_orders
All group orders have cutoff configured; stale orders are already closed/cancelled.
Single guard: skip if cutoff_date >= today (cycle still open).
2026-03-30 19:29:10 +02:00
snt
7fc42625a3 [FIX] website_sale_aplicoop: robust cutoff check in _confirm_linked_sale_orders
Three guards before confirming sale orders:
1. Skip if no cutoff_date (no cutoff_day configured): avoids blindly confirming
   all draft orders for group orders without a weekly cycle defined
2. Skip if cutoff_date >= today: cycle still open
3. Skip if cutoff_date >= 7 days ago: stale date from a previous cycle
   (protects against cron gaps and confirms only within 1-6 days after cutoff)
2026-03-30 19:23:19 +02:00
snt
cd68e8bb5b [FIX] website_sale_aplicoop: revert >= to > condition in _confirm_linked_sale_orders
The cutoff day itself is still open for orders; confirmation should only
happen when the cutoff date is strictly in the past (>= today = skip).
The real bug was only the order of operations in _cron_update_dates.
2026-03-30 19:18:41 +02:00
snt
ac00294623 [FIX] website_sale_aplicoop: fix auto-confirm sale.order on cutoff day
- _cron_update_dates: call _confirm_linked_sale_orders() BEFORE recomputing
  dates so cutoff_date still points to the current cycle when the check runs
- _confirm_linked_sale_orders: change >= to > so orders are confirmed both
  on the cutoff day itself and after it has passed
2026-03-30 19:14:02 +02:00
snt
7e13ffef07 [FIX] website_sale_aplicoop: evitar x2 en carrito y mostrar /Kg en granel 2026-03-30 19:07:57 +02:00
snt
6628e17fef [FIX] website_sale_aplicoop: reparar metadatos PO para upgrade 2026-03-30 19:01:25 +02:00
snt
5dbea009c0 [FIX] website_sale_aplicoop: evitar sobrecálculo en precio de envío
- Ajusta _get_delivery_product_display_price para calcular envío con list_price + impuestos
- Evita aplicar reglas de pricelist al envío (recargos/descuentos no deseados)
- Mantiene fallback seguro a list_price ante errores

Resultado esperado: para PVP 5.74 con IVA 21% => 6.95
2026-03-30 18:55:38 +02:00
snt
cfde009b64 traducciones 2026-03-30 18:49:34 +02:00
snt
439b7a6fda [I18N] website_sale_aplicoop: translate missing ES/EU strings (Save Draft, tooltips, UI labels) 2026-03-30 18:38:06 +02:00
snt
4421e93bda fix translate checkou 2026-03-30 18:15:15 +02:00
snt
0aaadd5fc2 [I18N] website_sale_aplicoop: sync curated ES/EU translations 2026-03-30 18:14:09 +02:00
snt
c345699bf4 [FIX] website_sale_aplicoop: invalidate stale carts on closed group orders 2026-03-30 17:39:15 +02:00
snt
89c008441e [FIX] Resolver 3 fallos de tests en website_sale_aplicoop
- Fix: delivery product price now includes VAT (homepage/checkout)
  * Added _get_delivery_product_display_price() helper to use same pricing pipeline as regular products
  * Uses pricelist + tax calculations instead of bare list_price
  * Fallback chain: pricelist → bare list_price → default 5.74
  * Updated context in eskaera_shop() and eskaera_checkout()

- Test: test_constraint_cutoff_before_pickup_invalid
  * Constraint removed: now allows any combination of cutoff_day and pickup_day
  * Updated test to reflect this change (no ValidationError expected)

- Test: test_day_names_not_using_inline_underscore
  * Fixed to check sub-template eskaera_order_card_meta where day_names is actually used
  * eskaera_page calls this sub-template so day_names context is inherited

Results: 128 tests - 0 failed, 0 errors (100% pass rate)
2026-03-30 16:21:57 +02:00
snt
e2ced75ecd [ADD] website_sale_aplicoop: create picking batches after cutoff
- Add stock_picking_batch dependency to manifest
- Add cutoff date validation in _confirm_linked_sale_orders()
- Create _create_picking_batches_for_sale_orders() method
- Group pickings by consumer_group_id into separate batches
- Set batch scheduled_date from group order pickup_date
- Add test_cron_picking_batch.py with 7 tests covering:
  - Skip orders before cutoff
  - Confirm orders after cutoff
  - Separate batches per consumer group
  - Same group orders in same batch
  - Batch has scheduled_date
  - No duplicate batches on re-run
  - Closed group orders not processed
2026-03-06 15:45:12 +01:00
snt
c3173a32c9 [IMP] website_sale_aplicoop: extract order card meta to separate template
- Create eskaera_order_card_meta template for cleaner code
- Simplify layout: horizontal meta-grid instead of table
- Fix t-if conditions on container elements
- Show only relevant fields: cutoff, pickup, delivery
- Add meta-grid CSS styles for compact horizontal display
- Home delivery badge only shown when enabled
2026-03-06 14:10:58 +01:00