diff --git a/stock_picking_to_batch_group_fields/README.rst b/stock_picking_to_batch_group_fields/README.rst new file mode 100644 index 000000000000..c42ccd7c9903 --- /dev/null +++ b/stock_picking_to_batch_group_fields/README.rst @@ -0,0 +1,122 @@ +================================== +Stock Picking To Batch Group Field +================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:958d5588f5eb42cdd38e4875cb99bfe19014da755878e820ce73a148fe2991ef + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-workflow/tree/18.0/stock_picking_to_batch_group_fields + :alt: OCA/stock-logistics-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-18-0/stock-logistics-workflow-18-0-stock_picking_to_batch_group_fields + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of the picking batch and allows +you to manually group pickings by any field in the model. + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +Currently this module +`stock_picking_batch_extended `__ +includes this functionality but to make it work it is necessary to +activate the OCA batches, which forces to use other behaviors than +Odoo's for the picking batches. + +It will be useful for you if you want to make the grouping of pickings +manually using any field of the delivery order. + +Configuration +============= + +To configure this module, you need to: + +1. Go to Inventory > Configuration > Settings > Operations. +2. Activate Batch, Wave & Cluster Transfers + +Usage +===== + +To use this module, you need to: + +1. Go to Inventory > Overview. +2. Access the pickings to process in one of the types of operations. +3. Select multiple pickings. +4. Click on Action > Add to batch. +5. Choose add to **a new batch transfer** and check **Group by fields** +6. Select the fields you want to group by. +7. Click on **Confirm**. +8. Multiple batches will be created by grouping the picking by the + fields you selected. +9. Fields you selected are saved and will be loaded for the next time. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Moduon + +Contributors +------------ + +- Emilio Pascual (`Moduon `__) +- Rafael Blasco (`Moduon `__) + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-EmilioPascual| image:: https://github.com/EmilioPascual.png?size=40px + :target: https://github.com/EmilioPascual + :alt: EmilioPascual + +Current `maintainer `__: + +|maintainer-EmilioPascual| + +This module is part of the `OCA/stock-logistics-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_picking_to_batch_group_fields/__init__.py b/stock_picking_to_batch_group_fields/__init__.py new file mode 100644 index 000000000000..40272379f721 --- /dev/null +++ b/stock_picking_to_batch_group_fields/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/stock_picking_to_batch_group_fields/__manifest__.py b/stock_picking_to_batch_group_fields/__manifest__.py new file mode 100644 index 000000000000..362ebc08e4d1 --- /dev/null +++ b/stock_picking_to_batch_group_fields/__manifest__.py @@ -0,0 +1,26 @@ +# Copyright 2024 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +{ + "name": "Stock Picking To Batch Group Field", + "summary": "Allows to create batches grouped by picking fields.", + "version": "18.0.1.0.1", + "development_status": "Beta", + "category": "Inventory/Delivery", + "website": "https://github.com/OCA/stock-logistics-workflow", + "author": "Moduon, Odoo Community Association (OCA)", + "maintainers": ["EmilioPascual"], + "license": "LGPL-3", + "application": False, + "installable": True, + "depends": [ + "stock_picking_batch", + ], + "excludes": [ + "stock_picking_batch_extended", + ], + "data": [ + "security/ir.model.access.csv", + "wizard/stock_picking_to_batch_views.xml", + ], +} diff --git a/stock_picking_to_batch_group_fields/i18n/es.po b/stock_picking_to_batch_group_fields/i18n/es.po new file mode 100644 index 000000000000..f9d0dea6d704 --- /dev/null +++ b/stock_picking_to_batch_group_fields/i18n/es.po @@ -0,0 +1,120 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_batch_group_field +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-02-06 09:03+0000\n" +"PO-Revision-Date: 2024-02-12 22:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \n" +"Language: es\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" +"X-Generator: Weblate 4.17\n" + +#. module: stock_picking_to_batch_group_fields +#. odoo-python +#: code:addons/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch.py:0 +#, python-format +msgid "" +"All selected pickings are already in a batch picking or are in a wrong state." +msgstr "" +"Todos los albaranes seleccionadas ya están en una agrupación o en un estado " +"incorrecto." + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model,name:stock_picking_to_batch_group_fields.model_stock_picking_batch_creator_group_field +msgid "Batch Picking Creator Group Field" +msgstr "Campo Grupo Creador de Selección por Lotes" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model,name:stock_picking_to_batch_group_fields.model_stock_picking_to_batch +msgid "Batch Transfer Lines" +msgstr "Líneas de agrupación de albaranes" + +#. module: stock_picking_to_batch_group_fields +#: model_terms:ir.ui.view,arch_db:stock_picking_to_batch_group_fields.stock_picking_to_batch_form_inherit +msgid "Create multiple batch picking grouped by..." +msgstr "Crear múltiples agrupaciones de albaranes agrupadas por..." + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__field_id +msgid "Field to group" +msgstr "Campo para agrupar" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__group_field_ids +msgid "Group by field" +msgstr "Agrupar por campo" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__sequence +msgid "Group by picking field" +msgstr "Agrupar por campo de albarán" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__batch_by_group +msgid "Grouped by fields" +msgstr "Agrupado por campos" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__id +msgid "ID" +msgstr "Identificación" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__group_field_ids +msgid "If set any, multiple batch picking will be created, one per group field" +msgstr "" +"Si se establece cualquiera, se crearán varios lotes, uno por campo de " +"agrupación" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__batch_by_group +msgid "If set, multiple batch picking will be created, one per group field" +msgstr "Si se establece, se crearán varios lotes, uno por campo de agrupación" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__write_date +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__picking_to_batch_id +msgid "Picking To Batch" +msgstr "Selección Por Lotes" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__sequence +msgid "Sequence" +msgstr "Secuencia" diff --git a/stock_picking_to_batch_group_fields/i18n/it.po b/stock_picking_to_batch_group_fields/i18n/it.po new file mode 100644 index 000000000000..6cdfc6d9ade7 --- /dev/null +++ b/stock_picking_to_batch_group_fields/i18n/it.po @@ -0,0 +1,121 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_to_batch_group_fields +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-02-16 16:37+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: stock_picking_to_batch_group_fields +#. odoo-python +#: code:addons/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch.py:0 +#, python-format +msgid "" +"All selected pickings are already in a batch picking or are in a wrong " +"state." +msgstr "" +"Tutti i prelievi selezionati sono già in un prelievo raggruppato o sono in " +"uno stato errato." + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model,name:stock_picking_to_batch_group_fields.model_stock_picking_batch_creator_group_field +msgid "Batch Picking Creator Group Field" +msgstr "Campo gruppo creazione prelievo raggruppato" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model,name:stock_picking_to_batch_group_fields.model_stock_picking_to_batch +msgid "Batch Transfer Lines" +msgstr "Righe trasferimento raggruppato" + +#. module: stock_picking_to_batch_group_fields +#: model_terms:ir.ui.view,arch_db:stock_picking_to_batch_group_fields.stock_picking_to_batch_form_inherit +msgid "Create multiple batch picking grouped by..." +msgstr "Creare gruppo prelievo multiplo raggruppato per..." + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__field_id +msgid "Field to group" +msgstr "Campo da raggruppare" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__group_field_ids +msgid "Group by field" +msgstr "Raggruppa per campo" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__sequence +msgid "Group by picking field" +msgstr "Raggruppa per campo prelievo" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__batch_by_group +msgid "Grouped by fields" +msgstr "Raggruppa per campi" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__id +msgid "ID" +msgstr "ID" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__group_field_ids +msgid "" +"If set any, multiple batch picking will be created, one per group field" +msgstr "" +"Se è settato, verrà creato un gruppo prelievo multiplo, uno per campo gruppo" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__batch_by_group +msgid "If set, multiple batch picking will be created, one per group field" +msgstr "" +"Se è settata, verrà creato un gruppo prelievo multiplo, uno per campo gruppo" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__picking_to_batch_id +msgid "Picking To Batch" +msgstr "Preleva al gruppo" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__sequence +msgid "Sequence" +msgstr "Sequenza" diff --git a/stock_picking_to_batch_group_fields/i18n/stock_picking_batch_group_field.pot b/stock_picking_to_batch_group_fields/i18n/stock_picking_batch_group_field.pot new file mode 100644 index 000000000000..060bb6fa8875 --- /dev/null +++ b/stock_picking_to_batch_group_fields/i18n/stock_picking_batch_group_field.pot @@ -0,0 +1,116 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_batch_group_field +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-02-06 09:03+0000\n" +"PO-Revision-Date: 2024-02-06 09:03+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_picking_batch_group_field +#. odoo-python +#: code:addons/stock_picking_batch_group_field/wizard/stock_picking_to_batch.py:0 +#, python-format +msgid "" +"All selected pickings are already in a batch picking or are in a wrong " +"state." +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model,name:stock_picking_batch_group_field.model_stock_picking_batch_creator_group_field +msgid "Batch Picking Creator Group Field" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model,name:stock_picking_batch_group_field.model_stock_picking_to_batch +msgid "Batch Transfer Lines" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model_terms:ir.ui.view,arch_db:stock_picking_batch_group_field.stock_picking_to_batch_form_inherit +msgid "Create multiple batch picking grouped by..." +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__create_date +msgid "Created on" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__field_id +msgid "Field to group" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_to_batch__group_field_ids +msgid "Group by field" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,help:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__sequence +msgid "Group by picking field" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_to_batch__batch_by_group +msgid "Grouped by fields" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__id +msgid "ID" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,help:stock_picking_batch_group_field.field_stock_picking_to_batch__group_field_ids +msgid "" +"If set any, multiple batch picking will be created, one per group field" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,help:stock_picking_batch_group_field.field_stock_picking_to_batch__batch_by_group +msgid "If set, multiple batch picking will be created, one per group field" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__picking_to_batch_id +msgid "Picking To Batch" +msgstr "" + +#. module: stock_picking_batch_group_field +#: model:ir.model.fields,field_description:stock_picking_batch_group_field.field_stock_picking_batch_creator_group_field__sequence +msgid "Sequence" +msgstr "" diff --git a/stock_picking_to_batch_group_fields/i18n/stock_picking_to_batch_group_fields.pot b/stock_picking_to_batch_group_fields/i18n/stock_picking_to_batch_group_fields.pot new file mode 100644 index 000000000000..f08125fc1bb2 --- /dev/null +++ b/stock_picking_to_batch_group_fields/i18n/stock_picking_to_batch_group_fields.pot @@ -0,0 +1,114 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_to_batch_group_fields +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_picking_to_batch_group_fields +#. odoo-python +#: code:addons/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch.py:0 +#, python-format +msgid "" +"All selected pickings are already in a batch picking or are in a wrong " +"state." +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model,name:stock_picking_to_batch_group_fields.model_stock_picking_batch_creator_group_field +msgid "Batch Picking Creator Group Field" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model,name:stock_picking_to_batch_group_fields.model_stock_picking_to_batch +msgid "Batch Transfer Lines" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model_terms:ir.ui.view,arch_db:stock_picking_to_batch_group_fields.stock_picking_to_batch_form_inherit +msgid "Create multiple batch picking grouped by..." +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__create_date +msgid "Created on" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__field_id +msgid "Field to group" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__group_field_ids +msgid "Group by field" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__sequence +msgid "Group by picking field" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__batch_by_group +msgid "Grouped by fields" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__id +msgid "ID" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__group_field_ids +msgid "" +"If set any, multiple batch picking will be created, one per group field" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,help:stock_picking_to_batch_group_fields.field_stock_picking_to_batch__batch_by_group +msgid "If set, multiple batch picking will be created, one per group field" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__picking_to_batch_id +msgid "Picking To Batch" +msgstr "" + +#. module: stock_picking_to_batch_group_fields +#: model:ir.model.fields,field_description:stock_picking_to_batch_group_fields.field_stock_picking_batch_creator_group_field__sequence +msgid "Sequence" +msgstr "" diff --git a/stock_picking_to_batch_group_fields/pyproject.toml b/stock_picking_to_batch_group_fields/pyproject.toml new file mode 100644 index 000000000000..4231d0cccb3d --- /dev/null +++ b/stock_picking_to_batch_group_fields/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_picking_to_batch_group_fields/readme/CONFIGURE.md b/stock_picking_to_batch_group_fields/readme/CONFIGURE.md new file mode 100644 index 000000000000..f6629766f9bf --- /dev/null +++ b/stock_picking_to_batch_group_fields/readme/CONFIGURE.md @@ -0,0 +1,4 @@ +To configure this module, you need to: + +1. Go to Inventory > Configuration > Settings > Operations. +2. Activate Batch, Wave & Cluster Transfers diff --git a/stock_picking_to_batch_group_fields/readme/CONTEXT.md b/stock_picking_to_batch_group_fields/readme/CONTEXT.md new file mode 100644 index 000000000000..a7cbf1001569 --- /dev/null +++ b/stock_picking_to_batch_group_fields/readme/CONTEXT.md @@ -0,0 +1,3 @@ +Currently this module [stock_picking_batch_extended](https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_batch_extended) includes this functionality but to make it work it is necessary to activate the OCA batches, which forces to use other behaviors than Odoo's for the picking batches. + +It will be useful for you if you want to make the grouping of pickings manually using any field of the delivery order. diff --git a/stock_picking_to_batch_group_fields/readme/CONTRIBUTORS.md b/stock_picking_to_batch_group_fields/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..dce7667b2744 --- /dev/null +++ b/stock_picking_to_batch_group_fields/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Emilio Pascual ([Moduon](https://www.moduon.team/)) +- Rafael Blasco ([Moduon](https://www.moduon.team/)) diff --git a/stock_picking_to_batch_group_fields/readme/DESCRIPTION.md b/stock_picking_to_batch_group_fields/readme/DESCRIPTION.md new file mode 100644 index 000000000000..789984c70d34 --- /dev/null +++ b/stock_picking_to_batch_group_fields/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module extends the functionality of the picking batch and allows you to manually group pickings by any field in the model. diff --git a/stock_picking_to_batch_group_fields/readme/USAGE.md b/stock_picking_to_batch_group_fields/readme/USAGE.md new file mode 100644 index 000000000000..8e9b2188af60 --- /dev/null +++ b/stock_picking_to_batch_group_fields/readme/USAGE.md @@ -0,0 +1,11 @@ +To use this module, you need to: + +1. Go to Inventory > Overview. +2. Access the pickings to process in one of the types of operations. +3. Select multiple pickings. +4. Click on Action > Add to batch. +5. Choose add to **a new batch transfer** and check **Group by fields** +6. Select the fields you want to group by. +7. Click on **Confirm**. +8. Multiple batches will be created by grouping the picking by the fields you selected. +9. Fields you selected are saved and will be loaded for the next time. diff --git a/stock_picking_to_batch_group_fields/security/ir.model.access.csv b/stock_picking_to_batch_group_fields/security/ir.model.access.csv new file mode 100644 index 000000000000..f5fea66cd349 --- /dev/null +++ b/stock_picking_to_batch_group_fields/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_stock_picking_batch_creator_group_field_user,access_stock_picking_batch_creator_group_field_user,model_stock_picking_batch_creator_group_field,stock.group_stock_user,1,1,1,1 +base.access_ir_model_fields_user,ir_model_fields all,base.model_ir_model_fields,base.group_user,1,0,0,0 diff --git a/stock_picking_to_batch_group_fields/static/description/icon.png b/stock_picking_to_batch_group_fields/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/stock_picking_to_batch_group_fields/static/description/icon.png differ diff --git a/stock_picking_to_batch_group_fields/static/description/index.html b/stock_picking_to_batch_group_fields/static/description/index.html new file mode 100644 index 000000000000..1fb38f84c688 --- /dev/null +++ b/stock_picking_to_batch_group_fields/static/description/index.html @@ -0,0 +1,464 @@ + + + + + +Stock Picking To Batch Group Field + + + +
+

Stock Picking To Batch Group Field

+ + +

Beta License: LGPL-3 OCA/stock-logistics-workflow Translate me on Weblate Try me on Runboat

+

This module extends the functionality of the picking batch and allows +you to manually group pickings by any field in the model.

+

Table of contents

+ +
+

Use Cases / Context

+

Currently this module +stock_picking_batch_extended +includes this functionality but to make it work it is necessary to +activate the OCA batches, which forces to use other behaviors than +Odoo’s for the picking batches.

+

It will be useful for you if you want to make the grouping of pickings +manually using any field of the delivery order.

+
+
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Go to Inventory > Configuration > Settings > Operations.
  2. +
  3. Activate Batch, Wave & Cluster Transfers
  4. +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Inventory > Overview.
  2. +
  3. Access the pickings to process in one of the types of operations.
  4. +
  5. Select multiple pickings.
  6. +
  7. Click on Action > Add to batch.
  8. +
  9. Choose add to a new batch transfer and check Group by fields
  10. +
  11. Select the fields you want to group by.
  12. +
  13. Click on Confirm.
  14. +
  15. Multiple batches will be created by grouping the picking by the +fields you selected.
  16. +
  17. Fields you selected are saved and will be loaded for the next time.
  18. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Moduon
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

EmilioPascual

+

This module is part of the OCA/stock-logistics-workflow project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_picking_to_batch_group_fields/tests/__init__.py b/stock_picking_to_batch_group_fields/tests/__init__.py new file mode 100644 index 000000000000..3c94163a8202 --- /dev/null +++ b/stock_picking_to_batch_group_fields/tests/__init__.py @@ -0,0 +1 @@ +from . import test_batch_group_field diff --git a/stock_picking_to_batch_group_fields/tests/test_batch_group_field.py b/stock_picking_to_batch_group_fields/tests/test_batch_group_field.py new file mode 100644 index 000000000000..79dc25cc6daf --- /dev/null +++ b/stock_picking_to_batch_group_fields/tests/test_batch_group_field.py @@ -0,0 +1,123 @@ +# Copyright 2024 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + + +from odoo.exceptions import UserError + +from odoo.addons.stock.tests.common import TestStockCommon + + +class StockPickingToBatchGroupField(TestStockCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.BatchObject = cls.env["stock.picking.batch"] + cls.pickingA = cls.PickingObj.with_context(planned=True).create( + { + "picking_type_id": cls.picking_type_out, + "location_id": cls.stock_location, + "location_dest_id": cls.customer_location, + "origin": "A", + "move_ids": [ + ( + 0, + 0, + { + "name": "Test move", + "product_id": cls.productA.id, + "product_uom_qty": 1, + "location_id": cls.stock_location, + "location_dest_id": cls.customer_location, + }, + ) + ], + } + ) + cls.pickingB = cls.PickingObj.with_context(planned=True).create( + { + "picking_type_id": cls.picking_type_out, + "location_id": cls.stock_location, + "location_dest_id": cls.customer_location, + "origin": "B", + "move_ids": [ + ( + 0, + 0, + { + "name": "Test move", + "product_id": cls.productB.id, + "product_uom_qty": 1, + "location_id": cls.stock_location, + "location_dest_id": cls.customer_location, + }, + ) + ], + } + ) + cls.pickings = cls.pickingA + cls.pickingB + cls.batch = cls.BatchObject.create({}) + + def test_sptb_existing_batch(self): + """Add pickings to existing batch""" + self.env["stock.picking.to.batch"].with_context( + active_ids=self.pickings.ids + ).create( + { + "batch_id": self.batch.id, + "mode": "existing", + } + ).attach_pickings() + self.assertEqual(len(self.pickings.mapped("batch_id")), 1) + self.assertEqual(self.pickingA.batch_id, self.batch) + self.assertEqual(self.pickingB.batch_id, self.batch) + + def test_sptb_new_batch_no_groupby(self): + """Add pickings to new batch and not groupby""" + self.env["stock.picking.to.batch"].with_context( + active_ids=self.pickings.ids + ).create( + { + "mode": "new", + "batch_by_group": False, + "group_field_ids": False, + } + ).attach_pickings() + self.assertEqual(len(self.pickings.mapped("batch_id")), 1) + + def test_sptb_new_batch_groupby_no_fields(self): + """Add picking to new batch and groupby checked but no fields""" + self.env["stock.picking.to.batch"].with_context( + active_ids=self.pickings.ids + ).create( + { + "mode": "new", + "batch_by_group": True, + "group_field_ids": False, + } + ).attach_pickings() + self.assertEqual(len(self.pickings.mapped("batch_id")), 1) + + def test_sptb_new_batch_groupby_fields(self): + """Add picking to new batch and group by fields""" + field_origin = self.env.ref("stock.field_stock_picking__origin") + field_scheduled_date = self.env.ref("stock.field_stock_picking__scheduled_date") + self.pickings.batch_id = self.batch + wizard = ( + self.env["stock.picking.to.batch"] + .with_context(active_ids=self.pickings.ids) + .create( + { + "mode": "new", + "batch_by_group": True, + "group_field_ids": [ + (0, 0, {"field_id": field_origin.id}), + (0, 0, {"field_id": field_scheduled_date.id}), + ], + } + ) + ) + with self.assertRaises(UserError): + wizard.attach_pickings() + self.pickings.batch_id = False + wizard.attach_pickings() + self.assertEqual(len(self.pickings.mapped("batch_id")), 2) diff --git a/stock_picking_to_batch_group_fields/wizard/__init__.py b/stock_picking_to_batch_group_fields/wizard/__init__.py new file mode 100644 index 000000000000..b9e498913e68 --- /dev/null +++ b/stock_picking_to_batch_group_fields/wizard/__init__.py @@ -0,0 +1 @@ +from . import stock_picking_to_batch diff --git a/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch.py b/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch.py new file mode 100644 index 000000000000..b1656a808569 --- /dev/null +++ b/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch.py @@ -0,0 +1,132 @@ +# Copyright 2024 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + + +from odoo import _, api, fields, models +from odoo.exceptions import UserError + + +class StockPickingToBatch(models.TransientModel): + _inherit = "stock.picking.to.batch" + + batch_by_group = fields.Boolean( + string="Grouped by fields", + help="If set, multiple batch picking will be created, one per group field", + ) + group_field_ids = fields.One2many( + comodel_name="stock.picking.batch.creator.group.field", + inverse_name="picking_to_batch_id", + string="Group by field", + help="If set any, multiple batch picking will be created, one per " + "group field", + ) + + @api.onchange("batch_by_group") + def onchange_batch_by_group(self): + if self.batch_by_group: + self.group_field_ids = False + for index, field in enumerate(self.load_store_fields()): + self.group_field_ids += self.group_field_ids.new( + {"sequence": index, "field_id": field.id} + ) + + def load_store_fields(self): + group_field_names = ( + self.env["ir.config_parameter"] + .sudo() + .get_param("stock_picking_to_batch_group_fields.group_field") + ) + if not group_field_names: + return self.env["ir.model.fields"].browse() + + return self.env["ir.model.fields"].search( + [ + ("model", "=", "stock.picking"), + ("name", "in", group_field_names.split(",")), + ] + ) + + @api.model + def default_get(self, fields): + """ + Set last grouped fields used that are stored in config parameters + """ + res = super().default_get(fields) + group_fields = self.load_store_fields() + res["batch_by_group"] = group_fields and True or False + return res + + def create_multiple_batch(self, domain): + """Create n batch pickings by grouped fields selected""" + StockPicking = self.env["stock.picking"] + groupby = [f.field_id.name for f in self.group_field_ids] + pickings_grouped = StockPicking.read_group(domain, groupby, groupby, lazy=False) + if not pickings_grouped: + raise UserError( + _( + "All selected pickings are already in a batch picking " + "or are in a wrong state." + ) + ) + batchs = self.env["stock.picking.batch"] + for group in pickings_grouped: + batch = self.env["stock.picking.batch"].create( + { + "user_id": self.user_id.id, + } + ) + StockPicking.search(group["__domain"]).write({"batch_id": batch.id}) + if self.mode == "new" and not self.is_create_draft: + batch.action_confirm() + batchs |= batch + return batchs + + def attach_pickings(self): + if self.mode == "new" and self.batch_by_group and self.group_field_ids: + domain = [ + ("id", "in", self.env.context["active_ids"]), + ("batch_id", "=", False), + ("state", "not in", ("cancel", "done")), + ] + batchs = self.create_multiple_batch(domain) + self.env["ir.config_parameter"].sudo().set_param( + "stock_picking_to_batch_group_fields.group_field", + ",".join([f.field_id.name for f in self.group_field_ids]), + ) + else: + super().attach_pickings() + batchs = ( + self.env["stock.picking"] + .browse(self.env.context.get("active_ids")) + .batch_id + ) + return self.action_view_batch_picking(batchs) + + def action_view_batch_picking(self, batch_pickings): + if len(batch_pickings) > 1: + action = self.env["ir.actions.act_window"]._for_xml_id( + "stock_picking_batch.stock_picking_batch_action" + ) + action["domain"] = [("id", "in", batch_pickings.ids)] + else: + action = batch_pickings.get_formview_action() + return action + + +class StockBatchPickingCreatorGroupField(models.TransientModel): + _name = "stock.picking.batch.creator.group.field" + _description = "Batch Picking Creator Group Field" + _order = "sequence, id" + + picking_to_batch_id = fields.Many2one( + comodel_name="stock.picking.to.batch", + ondelete="cascade", + required=True, + ) + sequence = fields.Integer(help="Group by picking field", default=0) + field_id = fields.Many2one( + comodel_name="ir.model.fields", + string="Field to group", + domain=[("model", "=", "stock.picking"), ("store", "=", True)], + required=True, + ) diff --git a/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch_views.xml b/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch_views.xml new file mode 100644 index 000000000000..607234eb70cf --- /dev/null +++ b/stock_picking_to_batch_group_fields/wizard/stock_picking_to_batch_views.xml @@ -0,0 +1,30 @@ + + + + + stock.picking.to.batch + + + + + + + + + + + + + + + + + +