Commit graph

389 commits

Author SHA1 Message Date
GitHub Copilot
b484e3dc2e [ADD] product_sale_price_from_pricelist: server action to bulk-correct purchase price from supplierinfo
- Add action_sync_purchase_price_from_supplierinfo on product.template:
  iterates variants, applies discount chain from main supplierinfo
  (according to last_purchase_price_compute_type), writes net price to
  last_purchase_price_received, recomputes theoretical sale price.
  Skips manual_update variants and products without a supplier.
  Returns a display_notification with updated/skipped counts.
- Register it as ir.actions.server bound to product.template list view.
- Add test_sync_action.py: 10 tests covering all discount types, skip
  cases, theoretical price recompute, notification type, idempotency,
  and bulk multi-template execution.
- Fix test_no_update_with_zero_quantity: update assertion to reflect that
  PO confirmation now syncs the cost via supplierinfo (intended behavior).
2026-06-12 16:30:15 +02:00
GitHub Copilot
9484f8c349 [FIX] website_sale_aplicoop: split cart and cycle stamp in localStorage
965c5c2 stored the cart as {cutoff_date, items: {...}} in
eskaera_<id>_cart. That broke every other reader of the same key:

- checkout_labels.js iterates Object.keys() expecting product IDs and
  rendered "cutoff_date" / "items" as ghost rows → users on the
  checkout page saw their cart as empty.
- home_delivery.js read/wrote the cart in place; the in-place mutation
  destroyed the wrapper.
- _saveOrderDraft serialised the same object straight to the server,
  POSTing "cutoff_date" and "items" as productIds.

Split the schema: eskaera_<id>_cart keeps the plain {productId: {...}}
shape every other JS file already relies on; the cycle marker moves to
eskaera_<id>_cart_cycle. _loadCart migrates browsers still holding the
v18.0.1.10.0 wrapped value on the next read.

Also make eviction strictly opt-in: drop the cart only when we know
the current cycle AND the stored cycle disagrees. Missing data on
either side (check-status didn't run, XHR failed) → preserve. This
restores the checkout page where check-status isn't called.

Version bump triggers the in-tab auto-reload added in 6e6d1e5 for
clients already on that build.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 15:37:55 +02:00
GitHub Copilot
6e6d1e5256 [IMP] website_sale_aplicoop: signal frontend to reload on deploy
When we ship a JS-only fix, users with a long-lived tab keep running
the old code until they hard-refresh — there is no clean way to push
new code to an already-loaded page. Now /eskaera/check-status returns
the module's installed_version as client_version, and the eskaera
page embeds the same version in data-build-version on the cart
container. The JS captures the page's build version at init; on every
check-status response it compares them and triggers window.location.
reload() on mismatch. A sessionStorage timestamp guards against
reload loops if the versions stay disagreeing (cached HTML upstream).

The version bump in __manifest__.py also invalidates the asset bundle
URL hash, so even users without this signalling path get fresh JS on
their next navigation.

This is forward-looking: clients on the old JS (no check) still need
one manual refresh today, but every future deploy will auto-recover.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 15:31:37 +02:00
GitHub Copilot
bd8d87060f Bump version 2026-06-04 15:22:19 +02:00
GitHub Copilot
48597ae8c7 add l10n_es_partner dependency for commercial name field. 2026-06-04 15:14:53 +02:00
GitHub Copilot
965c5c2495 [FIX] website_sale_aplicoop: stamp localStorage cart with cycle and evict on rollover
The cart was reappearing on stage with ghost items that had never been
saved as drafts on the server. Root cause: the localStorage cart had no
cycle awareness. Users who added items but never clicked Save left the
items in localStorage forever, and the only existing eviction path
(_clearCurrentOrderCartSilently via _checkGroupOrderStatus) only fires
when cutoff_passed flips true — which it rarely does, because the
stored cutoff_date is normally in the future for an active cycle. On
the next visit, _loadCart happily rehydrated the stale items and
_autoLoadDraftOnInit short-circuited because the cart was no longer
empty.

Stamp every cart written to localStorage with the cutoff_date it
belongs to and reject on cycle mismatch in _loadCart. The cutoff_date
is captured from /eskaera/check-status (which already returned it).
Legacy unstamped values and corrupt JSON are also dropped, so existing
browsers self-heal on first reload after the deploy.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 15:14:04 +02:00
GitHub Copilot
9a9139711f change order in basket assembly view 2026-06-04 13:53:16 +02:00
GitHub Copilot
d35c3383b2 [FIX] product_sale_price_from_pricelist: apply supplier discounts from supplierinfo
The sale price was computed from a gross last_purchase_price_received when
the product relied on its supplierinfo (no stock receipt), ignoring the
vendor discounts even with last_purchase_price_compute_type set.

Sync last_purchase_price_received from the main vendor's supplierinfo on
create/write, applying its discounts according to compute_type (mirrors the
stock.move receipt logic): without_discounts keeps the gross price, with_*
discounts apply 1/2/all three, manual_update is left untouched. The
theoretical price is refreshed (and last_purchase_price_updated flagged)
without overwriting lst_price until the user confirms.

Also drop the redundant _compute_price_rule call in _compute_theoritical_price
by asking the pricelist for the price directly instead of going through
_get_price (which computed the price twice).

Add purchase_triple_discount as an explicit dependency and tests covering
every discount type, manual_update, write re-sync and the main-vendor rule.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 13:51:48 +02:00
GitHub Copilot
9a7dfe02db [ADD] Claude Code ecosystem adapted from Copilot config
Port .github Copilot setup to Claude Code:
- CLAUDE.md: condensed project instructions (auto-loaded each session)
- .claude/skills: per-language guides (odoo-python, odoo-xml-views,
  odoo-qweb-html, odoo-javascript) + openspec-* workflow skills
- .claude/commands/opsx: /opsx:explore|propose|apply|archive slash commands

Original .github/ files kept untouched as extended reference.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 13:29:10 +02:00
GitHub Copilot
8798f321b3 create monthly recurring membership lines 2026-06-02 14:22:13 +02:00
a0ba3426c8 fix comercial name in supplier info 2026-06-02 10:50:36 +00:00
GitHub Copilot
87dcb4e350 cron better exception management. show supplier commercial name in product card template. linters config 2026-06-02 10:43:54 +02:00
GitHub Copilot
a812b4385d [IMP] stock_picking_batch_custom: rename operator view button to Basket Assembly
Add es/eu translations: Montaje de Cestas / Saskien Prestaketa.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 19:43:16 +02:00
GitHub Copilot
be7f379c1e [FIX] stock_picking_batch_custom: fix is_collected toggle clipping in operator view
Replace transform: scale() (which clips at parent boundaries) with direct
width/height on the form-check-input element so the switch grows without overflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 19:37:09 +02:00
GitHub Copilot
f5ba2d786c [FIX] stock_picking_batch_custom: fix CSS specificity for quantity font-size in operator view
The general tbody tr.o_data_row td rule had higher specificity (0,3,2) than
td[name="quantity"] (0,2,1), overriding the 1.5rem font-size. Fixed by using
tbody tr.o_data_row td[name="quantity"] (0,3,3) for the size/weight override.
Also fixed table. prefix on all selectors: arch class lands on the controller
root div, not the <table> element.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 19:32:34 +02:00
GitHub Copilot
483c4ad5a7 [FIX] stock_picking_batch_custom: apply quantity font size/weight to td directly
In read mode the value is plain text inside <td name="quantity"> with no
widget wrapper, so font-size and font-weight must target the td itself,
not only .o_field_widget input (edit mode only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 19:04:20 +02:00
GitHub Copilot
591dd5f2b2 [IMP] stock_picking_batch_custom: larger bold quantity in operator view
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 18:53:22 +02:00
GitHub Copilot
a9a14e7db5 [IMP] stock_picking_batch_custom: add full-screen operator view for batch picking
Add a "Vista Operarios" button in the batch form header (visible when
in_progress) that opens a full-screen list of stock.move.line filtered
by the current batch. The view shows only the fields operators need
(category, product, partner, home_delivery, consumer_group, collected,
quantity) with larger rows and touch-friendly quantity input via CSS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 18:30:46 +02:00
GitHub Copilot
c8e0461120 [IMP] website_sale_aplicoop: render user-defined website_sale ribbon alongside stock ribbon
Eskaera shop cards now display the standard website_sale ribbon
(variant_ribbon_id or website_ribbon_id, e.g. "Novedad") in addition
to the dynamic stock ribbon. Stock ribbons move to the right so they
coexist with user-defined ribbons (which default to the left).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 18:11:47 +02:00
GitHub Copilot
3b8cb7582b [FIX] website_sale_aplicoop: scope draft lookup to active cycle window
The /eskaera/load-draft endpoint was returning previous-cycle drafts when
group_order.cutoff_date was still in the future but group_order.pickup_date
had not yet been recomputed (its compute only depends on pickup_day and
start_date). Both the stale group_order.pickup_date and the old draft's
pickup_date held the same past value, so the exact-pickup-date filter in
_find_recent_draft_order matched the stale draft and the cart was
repopulated with old products immediately after being cleared.

Replace the pickup_date exact-match + current-week fallback with a single
cutoff-anchored window: create_date in [cutoff_date - 6 days, cutoff_date].
Drafts created outside that window belong to a previous cycle and must
not be reused. The change applies to all four callers (load-draft,
clear-cart, save-order, confirm) so the merge/confirm paths also stop
attaching to stale drafts.

Covered by a new regression test that mirrors the production setup
(matching pickup_date, draft create_date backdated 10 days).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 17:40:48 +02:00
GitHub Copilot
6125515772 [IMP] stock_picking_batch_custom: order detailed ops by category, product, partner
Override _order on stock.move.line using the existing stored Many2one fields.
Odoo JOINs product.category and uses its _order (complete_name, which is stored)
so the full category path is used for sorting without any extra fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 20:22:18 +02:00
GitHub Copilot
f5670906f9 [IMP] stock_picking_batch_custom: order detailed ops by category, product, partner
Override _order on stock.move.line with stored Char fields so the server
returns records in the correct order on initial load (default_order in the
view only applies to interactive client-side sorting, not the initial fetch).

Add product_name and partner_name stored related fields to avoid SQL JOINs
in ORDER BY. Use the same fields in the view's default_order for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 20:12:39 +02:00
GitHub Copilot
8b9995526e [IMP] stock_picking_batch_custom: order detailed ops by category, product, partner
Store picking_partner_id on stock.move.line and set default_order to
product_categ_complete_name, product_id, picking_partner_id in the
detailed operations view so sorting uses the full category path
(e.g. 'SECO ENVASADO / Aperitivos') instead of only the leaf name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 20:01:17 +02:00
GitHub Copilot
16941b8183 [IMP] stock_picking_batch_custom: increase quantity column size for touch usability
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 19:32:20 +02:00
GitHub Copilot
72da09715d [IMP] stock_picking_batch_custom: widen quantity column for easier touch interaction
Add o_batch_move_line_list class to the detailed ops list and use it to
set min-width: 100px on the quantity column header and cells.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 19:31:34 +02:00
GitHub Copilot
c9188e4f10 [IMP] stock_picking_batch_custom: order detailed ops by category, product, partner
Store picking_partner_id on stock.move.line and set default_order to
product_categ_id, product_id, picking_partner_id in the detailed operations view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 19:25:46 +02:00
GitHub Copilot
e2a22c5d71 Save Draft transation 2026-05-28 13:53:00 +02:00
GitHub Copilot
b01794c319 [FIX] website_sale_aplicoop: clear cart when group order cutoff has passed
Previously, when a user reopened a group order whose cutoff day had
already passed, the /eskaera/check-status response correctly triggered
the localStorage cart clear, but _autoLoadDraftOnInit immediately
re-fetched the previous cycle's draft sale.order from /eskaera/load-draft
(which only guarded on group_order.state, not cutoff_date) and the stale
items reappeared in the cart, confusing users.

Add a cutoff_date < today guard to load_draft_cart so the endpoint
returns the existing clear_cart unavailable response, and short-circuit
_autoLoadDraftOnInit on the frontend via a _skipDraftAutoLoad flag set
in _checkGroupOrderStatus to avoid the now-pointless XHR round trip.

Covered by a new regression test in tests/test_group_order_status_endpoint.py.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 13:51:37 +02:00
GitHub Copilot
98ffcdaefb [IMP] l10n_es_edi_tbai_reagyp_recibidas: add Criptomart module icon
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 14:18:46 +02:00
GitHub Copilot
66a5e31060 [ADD] l10n_es_edi_tbai_reagyp_recibidas: fix REAGYP vendor bill regime key
Native l10n_es_edi_tbai hardcodes ClaveRegimenIvaOpTrascendencia '19' for
REAGYP vendor bills, but '19' only exists in the issued-invoices book. The
Batuz LROE schema for received invoices rejects it (cvc-enumeration-valid),
where the valid REAGYP-compensation key is '02'.

Override _l10n_es_tbai_get_vendor_bill_values_batuz to remap 19 -> 02.
Upstream: https://github.com/odoo/odoo/pull/266214

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 14:12:16 +02:00
GitHub Copilot
eb515c28e1 [FIX] website_sale_aplicoop: show pickup slots on checkout page
Replace old pickup_day/pickup_date display with the slot-based logic
(pickup_slot_ids) on the checkout page, consistent with the shop page.
Falls back to legacy pickup_day if no slots are configured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 13:44:34 +02:00
GitHub Copilot
5eb8274192 [IMP] stock_picking_batch_custom: add partner column to detailed operations
Show picking_partner_id after product_id in the detailed operations
list so the destination contact is visible next to the product.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 12:38:15 +02:00
GitHub Copilot
5eea3e2a23 [IMP] website_sale_aplicoop: improve i18n label fallbacks and response parsing
Add hardcoded fallback translations for es/eu when PO-based translation
returns the source string unchanged. Expand labels dict with all keys
needed by the frontend. Fix JSON response parsing in template
(data.result || data). Add js_translations keys. Add pot file for
stock_picking_batch_custom.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 12:28:33 +02:00
GitHub Copilot
647438e012 [FIX] website_sale_aplicoop: home delivery unchecked by default
The checkout home-delivery checkbox had a fixed checked="checked"
attribute, so it always rendered checked even when the delivery
product was not in the cart. Remove it and let checkDeliveryInCart()
mark it only when the delivery product is actually present.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 12:26:04 +02:00
GitHub Copilot
98fe8676ea group order form notebook 2026-05-21 17:37:22 +02:00
GitHub Copilot
1b20142b6f [IMP] stock_picking_batch_custom: add is_collected to detailed operations view
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:47:19 +02:00
GitHub Copilot
a6e8c975f2 [IMP] stock_picking_batch_custom: add home_delivery and consumer_group_id to detailed ops view
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:46:21 +02:00
GitHub Copilot
9547193083 [IMP] stock_picking_batch_custom: show product code as separate optional column
Add product_default_code related field to stock.move.line and
stock.picking.batch.summary.line. Show it as a hidden-by-default column
to the right of product_id in both detailed operations and product summary
views. Hide the code prefix from the product name via display_default_code
context so sorting is alphabetical.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:44:54 +02:00
GitHub Copilot
f25d2b5e2c [IMP] stock_picking_batch_custom: hide location and picking fields by default in detailed ops
Hide location_id, location_dest_id and picking_id (optional=hide) in the
detailed operations list view to reduce visual clutter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:40:26 +02:00
GitHub Copilot
4d5e0c5502 [IMP] stock_picking_batch_custom: show product category in detailed operations view
Add product_categ_id before product_id (visible by default) and hide
company and unit of measure fields by default in the detailed operations tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 16:22:57 +02:00
GitHub Copilot
b0dc189708 traducciones 2026-05-21 16:14:04 +02:00
GitHub Copilot
e1c3da6246 traducciones 2026-05-21 15:29:45 +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
4ea0286b52 cron update sale order lines 2026-05-21 13:37:10 +02:00
GitHub Copilot
56509892e6 [FIX] stock_picking_batch_custom: fix zebra striping selectors for Odoo 18
Replace old Odoo 16/17 class names (.o_list_view_table) with Odoo 18
equivalents (table.o_list_table, tr.o_data_row) so zebra striping
renders correctly in the detailed operations list view.

Remove background:transparent rule on .o_field_widget * that was
breaking the boolean_toggle widget appearance on striped rows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 12:25:55 +02:00
GitHub Copilot
07bd632537 [FIX] stock_picking_batch_custom: fix zebra striping selectors for Odoo 18
Replace old Odoo 16/17 class names (.o_list_view_table) with Odoo 18
equivalents (table.o_list_table, tr.o_data_row) so zebra striping
renders correctly in the detailed operations list view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 18:23:55 +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