Commit graph

315 commits

Author SHA1 Message Date
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
496e8918cb [FIX] product_origin_char: remove supplierinfo origin_text remnants 2026-03-31 15:41:33 +02:00
snt
d4be0ae23e [FIX] stock_picking_batch_custom: require collected before batch validation 2026-03-30 19:42:21 +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
5efe57dc19 [REF] product_origin_char: simplify to template-based origin
- Move origin_text field from product.supplierinfo to product.template
- Add related field in product.product for variant access
- Remove dependency on product_main_seller
- Update views to show field near category (editable)
- Rewrite tests for new architecture
- Update all documentation (README, readme/ fragments)
- Bump version to 18.0.2.0.0
2026-03-06 17:43:20 +01: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
snt
80539f3e36 [IMP] website_sale_aplicoop: propagate consumer_group_id directly from group_order
- Add consumer_group_id to sale.order for tracking the consumer group
- Fix stock.picking consumer_group_id to use sale_id.consumer_group_id
- Add group_ids inverse relation in res.partner for bidirectional access
- Remove auto-calculation of consumer_group_id, data comes directly from group_order.group_ids[0]
- Add debug logging for consumer_group propagation
- commitment_date propagates directly from group_order (no recalculation)
2026-03-06 13:49:13 +01:00
snt
4141fc5ab1 [IMP] website_sale_aplicoop: respect allow_out_of_stock_order
Added website_sale_stock dependency and modified _compute_stock_ribbons
to respect the allow_out_of_stock_order field:
- If allow_out_of_stock_order=True: product can always be added to cart
- If allow_out_of_stock_order=False and qty<=0: add-to-cart is blocked

The JS logic already checks data-out-of-stock attribute from template,
so no frontend changes were needed.

Version bump: 18.0.1.7.0 -> 18.0.1.8.0
2026-03-05 22:15:50 +01:00
snt
d3f26120b0 [FIX] website_sale_aplicoop: fix aplicoopShop -> groupOrderShop reference
After infinite scroll loads new products, the event listeners were
never re-attached because the code was looking for window.aplicoopShop
but the actual object is window.groupOrderShop.
2026-03-05 22:03:34 +01:00
snt
3eeca66551 [FIX] stock_picking_batch_custom: prevent product_id null error on summary lines
- Use regular dict instead of defaultdict to avoid empty entries
- Make summary_line_ids readonly=True to prevent UI from inserting empty lines
- Add SQL constraint CHECK(product_id IS NOT NULL) as safeguard
- Use boolean_toggle widget for is_collected field
- Fix tests to use TransactionCase and invalidate_recordset
- Add test for empty batch + add pickings + confirm flow
2026-03-05 21:47:18 +01:00
snt
ad8b759643 [ADD] stock_picking_batch_custom: product summary 2026-03-05 20:29:17 +01:00
snt
9c14e1dc1a [FIX] website_sale_aplicoop: ensure add-to-cart on infinite scroll 2026-03-05 18:57:10 +01:00
snt
eaedf0b421 [FIX] website_sale_aplicoop: hard block out-of-stock button 2026-03-03 15:49:19 +01:00
snt
33c148e6a1 [FIX] website_sale_aplicoop: block out-of-stock add 2026-03-03 15:30:43 +01:00
snt
9bd48654fd [I18N] website_sale_aplicoop: Translate weekdays 2026-03-03 15:26:01 +01:00
snt
62a1c4e1e9 [FIX] website_sale_aplicoop: force enable cart buttons 2026-03-03 15:09:16 +01:00
snt
6cc0a18de3 [FIX] website_sale_aplicoop: enable add to cart 2026-03-03 14:58:47 +01:00
snt
a9c1f1f609 [FIX] website_sale_aplicoop: align pricing and drafts 2026-02-27 19:39:25 +01:00
snt
aef57a3de4 [DOC] product_sale_price_from_pricelist: actualizar documentación v18.0.2.7.0
- CHANGELOG: documentar nueva funcionalidad de actualización de órdenes de venta
- README: añadir sección sobre Update Sales Orders from List Price
- README_DEV: incluir uso de la acción en workflow
- readme/USAGE: detallar paso a paso para actualizar órdenes

Funcionalidad documentada:
- Botón/acción para actualizar líneas de orden de venta con precio actual del producto
- Solo procesa órdenes no facturadas/canceladas
- Preserva descuentos, omite notas/secciones y anticipos
- Disponible en vista formulario y lista
2026-02-27 17:10:53 +01:00
snt
d294843241 [DOC] stock_picking_batch_custom: documentación OCA 2026-02-27 17:09:22 +01:00
snt
55497327e8 [ADD] product_sale_price_from_pricelist: update sale orders from list price 2026-02-27 17:05:54 +01:00
snt
ced21cc489 [ADD] stock_picking_batch_custom: columnas opcionales partner y categoría 2026-02-27 16:03:25 +01:00
snt
97dc41d212 [FIX] website_sale_aplicoop: toggle reparto desde carrito 2026-02-27 15:43:59 +01:00
snt
2f57a5d14e [IMP] group_order: confirmar sale orders en cron diario 2026-02-27 15:19:41 +01:00