[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>
This commit is contained in:
GitHub Copilot 2026-08-27 14:26:47 +02:00
parent 704f0def1b
commit ef1283be7c
42 changed files with 926 additions and 709 deletions

View file

@ -0,0 +1,235 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_batch_collect
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-05-21 13:21+0000\n"
"PO-Revision-Date: 2026-05-21 13:21+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: eu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: stock_picking_batch_collect
#: model:ir.model.fields.selection,name:stock_picking_batch_collect.selection__res_company__batch_detailed_restriction_scope__all
msgid "All detailed lines"
msgstr "Lerro xehatu guztiak"
#. module: stock_picking_batch_collect
#: model:ir.model.fields.selection,name:stock_picking_batch_collect.selection__res_company__batch_summary_restriction_scope__all
msgid "All summary products"
msgstr "Laburpeneko produktu guztiak"
#. module: stock_picking_batch_collect
#: model:ir.model,name:stock_picking_batch_collect.model_stock_backorder_confirmation
msgid "Backorder Confirmation"
msgstr "Eskaeraren informazioa"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__batch_id
msgid "Batch"
msgstr "Lotea"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking__batch_consumer_group_id
msgid "Batch Consumer Group"
msgstr "Loteko kontsumitzaile taldea"
#. module: stock_picking_batch_collect
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_collect.res_config_settings_view_form_inherit_batch_custom
msgid "Batch Detailed Operations Restriction"
msgstr "Loteko eragiketa xehatuen murrizketa"
#. module: stock_picking_batch_collect
#: model:ir.model,name:stock_picking_batch_collect.model_stock_picking_batch_summary_line
msgid "Batch Product Summary Line"
msgstr "Loteko produktuen laburpen-lerroa"
#. module: stock_picking_batch_collect
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_collect.res_config_settings_view_form_inherit_batch_custom
msgid "Batch Product Summary Restriction"
msgstr "Loteko produktuen laburpenaren murrizketa"
#. module: stock_picking_batch_collect
#: model:ir.model,name:stock_picking_batch_collect.model_stock_picking_batch
msgid "Batch Transfer"
msgstr "Lote-transferentzia"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_move_line__is_collected
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__is_collected
msgid "Collected"
msgstr "Jasota"
#. module: stock_picking_batch_collect
#: model:ir.model,name:stock_picking_batch_collect.model_res_company
msgid "Companies"
msgstr "Enpresak"
#. module: stock_picking_batch_collect
#: model:ir.model,name:stock_picking_batch_collect.model_res_config_settings
msgid "Config Settings"
msgstr "Konfigurazio ezarpenak"
#. module: stock_picking_batch_collect
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_collect.res_config_settings_view_form_inherit_batch_custom
msgid "Configuración de restricciones para la pestaña Operaciones Detalladas."
msgstr "Eragiketa xehatuak fitxarako murrizketen konfigurazioa."
#. module: stock_picking_batch_collect
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_collect.res_config_settings_view_form_inherit_batch_custom
msgid "Configuración de restricciones para la pestaña Product Summary."
msgstr "Produktuen laburpena fitxarako murrizketen konfigurazioa."
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_move_line__consumer_group_id
msgid "Consumer Group"
msgstr "Kontsumitzaile taldea"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__create_uid
msgid "Created by"
msgstr "Nork sortua"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__create_date
msgid "Created on"
msgstr "Noiz sortua"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__qty_demanded
msgid "Demanded Quantity"
msgstr "Eskatutako kantitatea"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_company__batch_detailed_restriction_scope
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_config_settings__batch_detailed_restriction_scope
msgid "Detailed Operations Restriction Scope"
msgstr "Eragiketa xehatuen murrizketaren irismena"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__display_name
msgid "Display Name"
msgstr "Bistaratzeko izena"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__qty_done
msgid "Done Quantity"
msgstr "Egindako kantitatea"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_company__batch_detailed_restriction_enabled
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_config_settings__batch_detailed_restriction_enabled
msgid "Enforce Detailed Operations Restriction"
msgstr "Eragiketa xehatuen murrizketa aplikatu"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_company__batch_summary_restriction_enabled
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_config_settings__batch_summary_restriction_enabled
msgid "Enforce Product Summary Restriction"
msgstr "Produktuen laburpenaren murrizketa aplikatu"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_move_line__home_delivery
msgid "Home Delivery"
msgstr "Etxez etxeko entrega"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__id
msgid "ID"
msgstr "ID"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__write_uid
msgid "Last Updated by"
msgstr "Azken eguneratzailea"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__write_date
msgid "Last Updated on"
msgstr "Azken eguneratzea"
#. module: stock_picking_batch_collect
#: model:ir.model.fields.selection,name:stock_picking_batch_collect.selection__res_company__batch_detailed_restriction_scope__processed
msgid "Only processed lines"
msgstr "Prozesatutako lerroak soilik"
#. module: stock_picking_batch_collect
#: model:ir.model.fields.selection,name:stock_picking_batch_collect.selection__res_company__batch_summary_restriction_scope__processed
msgid "Only processed products"
msgstr "Prozesatutako produktuak soilik"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__qty_pending
msgid "Pending Quantity"
msgstr "Zain dagoen kantitatea"
#. module: stock_picking_batch_collect
#. odoo-python
#: code:addons/stock_picking_batch_collect/models/stock_picking_batch.py:0
msgid "Pending products: %(products)s"
msgstr "Zain dauden produktuak: %(products)s"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__product_id
msgid "Product"
msgstr "Produktua"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__product_categ_id
msgid "Product Category"
msgstr "Produktu-kategoria"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_move_line__product_categ_id
msgid "Product Category (Batch)"
msgstr "Produktu-kategoria (lotea)"
#. module: stock_picking_batch_collect
#: model:ir.model,name:stock_picking_batch_collect.model_stock_move_line
msgid "Product Moves (Stock Move Line)"
msgstr "Produktuen mugimenduak (stock mugimenduaren lerroa)"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch__summary_line_ids
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_collect.view_stock_picking_batch_form_inherit_summary
msgid "Product Summary"
msgstr "Produktuen laburpena"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_company__batch_summary_restriction_scope
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_res_config_settings__batch_summary_restriction_scope
msgid "Product Summary Restriction Scope"
msgstr "Produktuen laburpenaren murrizketaren irismena"
#. module: stock_picking_batch_collect
#: model:ir.model.constraint,message:stock_picking_batch_collect.constraint_stock_picking_batch_summary_line_product_required
msgid "Product is required for summary lines."
msgstr "Produktua derrigorrezkoa da laburpen-lerroetan."
#. module: stock_picking_batch_collect
#: model:ir.model,name:stock_picking_batch_collect.model_stock_picking
msgid "Transfer"
msgstr "Transferentzia"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,field_description:stock_picking_batch_collect.field_stock_picking_batch_summary_line__product_uom_id
msgid "Unit of Measure"
msgstr "Neurri-unitatea"
#. module: stock_picking_batch_collect
#: model:ir.model.fields,help:stock_picking_batch_collect.field_stock_move_line__home_delivery
msgid "Whether this picking includes home delivery (from sale order)"
msgstr ""
"Albaran honek etxez etxeko entrega barne hartzen duen (salmenta-eskaeratik)"
#. module: stock_picking_batch_collect
#: model_terms:ir.ui.view,arch_db:stock_picking_batch_collect.view_stock_picking_batch_form_inherit_summary
msgid "Basket Assembly"
msgstr "Saskien Prestaketa"