Commit graph

23 commits

Author SHA1 Message Date
GitHub Copilot
ef1283be7c [REF] stock_picking_batch_collect: rename and drop the aplicoop dependency
"custom" said nothing about what the module does. It is really about collecting
goods into baskets: the extra detailed-operation columns, the is_collected flag,
the Product Summary tab, the per-company validation restrictions and the
Basket Assembly operator view all serve that one job. Rename it accordingly.

Invert the dependency while at it. A generic warehouse addon was dragging in an
entire eCommerce application, and the whole coupling was a single field:
stock.move.line.home_delivery, related to picking_id.home_delivery. Everything
else was already duck-typed. website_sale_aplicoop now depends on this module
and injects its own consumer group columns into these views.

This removes duplicated logic rather than relocating it: stock.picking
.batch_consumer_group_id re-derived from sale_id a value aplicoop already stored
as stock.picking.consumer_group_id, and the duplicate carried no @api.depends,
so it never recomputed reliably. The batch transfers list now shows the stored
field, which is sortable and groupable.

The two aplicoop tests that probed information_schema for the res_company
batch_* columns can drop that guard: a real dependency guarantees them.

Renaming an addon is not something a migrations/ script can do, since a renamed
addon is a brand new module to Odoo and its migration scripts never run. A
pre_init_hook does it instead: it fires on install after the Python is imported
but before registry.load(), which is the window where remapping ir_model_data
makes Odoo reuse the existing tables and columns. is_collected, the summary line
table and the company settings all survive untouched.

Two details the hook has to get right:

- ir_model_constraint.module and ir_model_relation.module are integer FKs with
  ON DELETE CASCADE, so they must be repointed before the old module row is
  deleted or the bookkeeping goes with it.
- Deleting an ir_model_data row does not cascade to the record it points at.
  Artifacts handed over to aplicoop only need the xmlid dropped, but artifacts
  that disappear need the record deleted too, or the field survives as an orphan
  manual field and the view as a custom view referencing it.

Verified against a restored copy of the dev database: 50 xmlids moved, 19 summary
lines and 5 collected move lines preserved, no orphans, both test suites green,
and the module installs cleanly on a database without website_sale_aplicoop.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 14:26:47 +02:00
GitHub Copilot
2e7549f857 [IMP] stock_picking_batch_custom: keep the weighed quantity on the operator view
Basket Assembly is where the reverting quantity was noticed, so it depends
on stock_move_manual_quantity now and its two lists load `picked`: the web
client only saves the fields present in the arch, and without it the
onchange that freezes a hand-typed quantity never reaches the server.

Collecting a line does the same, minus the demand. It is the operator saying
the goods are in the basket, so the quantity has to survive the reservation
engine even when it was never retyped -- but only a quantity typed by hand
says what the demand should become, and a line collected at zero would
otherwise lose its demand and be cancelled on validation.

Drops views/stock_move_line_views.xml on the way. It declared a second
record under the id stock_picking_batch_views.xml already uses, so it was
loaded first and immediately overwritten: dead weight that would have turned
into a duplicate-field view had anyone renamed it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 13:26:56 +02:00
GitHub Copilot
07b0e546c4 [IMP] stock_picking_batch_custom: allow deleting operator lines, show picking reference
Allow removing stock.move.line records from the Basket Assembly operator
view (select + Delete action) instead of forcing quantity to zero, which
caused issues for operators. Also expose the picking reference field
(hidden by default) before the contact column.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-15 16:26:14 +02:00
GitHub Copilot
9a9139711f change order in basket assembly view 2026-06-04 13:53:16 +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
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
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
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
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
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
snt
4a928e92dd [FIX] stock_picking_batch_custom: mover inclusión de CSS a manifest assets 2026-05-20 16:05:14 +02:00
snt
3372cb453b [FIX] stock_picking_batch_custom: quitar company_id inexistente en summary line view 2026-05-20 16:05:14 +02:00
snt
1b20b23fc0 [IMP] stock_picking_batch_custom: UX - zebra rows, mostrar categoría a la izquierda, company+uom ocultables, añadir CSS assets 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
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