diff --git a/stock_picking_line_sequence/README.rst b/stock_picking_line_sequence/README.rst new file mode 100644 index 000000000000..d2fe07201d62 --- /dev/null +++ b/stock_picking_line_sequence/README.rst @@ -0,0 +1,85 @@ +======================================== +Stock picking lines with sequence number +======================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-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/12.0/stock_picking_line_sequence + :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-12-0/stock-logistics-workflow-12-0-stock_picking_line_sequence + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/154/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + + +Provide a new field sequence on stock moves, which allows to manage the order of moves in a picking. + +For further information, please visit: + +* https://www.odoo.com/forum/help-1 + +**Table of contents** + +.. contents:: + :local: + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ArcheTI +* Camptocamp +* Eficent +* Serpent CS + +Contributors +~~~~~~~~~~~~ + +* Cécile Jallais +* Alexandre Fayolle +* Damien Crier +* Eficent Business and IT Consulting Services S.L. +* Serpent Consulting Services Pvt. Ltd. + +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. + +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_line_sequence/__init__.py b/stock_picking_line_sequence/__init__.py new file mode 100644 index 000000000000..1b5be8489697 --- /dev/null +++ b/stock_picking_line_sequence/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models +from .init_hooks import post_init_hook diff --git a/stock_picking_line_sequence/__manifest__.py b/stock_picking_line_sequence/__manifest__.py new file mode 100644 index 000000000000..94a73442be96 --- /dev/null +++ b/stock_picking_line_sequence/__manifest__.py @@ -0,0 +1,26 @@ +# Copyright 2017 Camptocamp SA - Damien Crier, Alexandre Fayolle +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2017 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Stock picking lines with sequence number", + "summary": "Manages the order of stock moves by displaying its sequence", + "version": "14.0.1.0.0", + "category": "Warehouse Management", + "author": "Camptocamp, " + "Eficent, " + "Serpent CS, " + "Odoo Community Association (OCA), " + "ArcheTI", + "website": "https://github.com/OCA/stock-logistics-workflow", + "depends": ["stock", "sale", "sale_stock"], + "data": [ + "views/stock_view.xml", + "report/report_deliveryslip.xml", + ], + "post_init_hook": "post_init_hook", + "installable": True, + "auto_install": False, + "license": "AGPL-3", +} diff --git a/stock_picking_line_sequence/i18n/ca.po b/stock_picking_line_sequence/i18n/ca.po new file mode 100644 index 000000000000..0b9960616442 --- /dev/null +++ b/stock_picking_line_sequence/i18n/ca.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Moure l'estoc" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_line_sequence/i18n/de.po b/stock_picking_line_sequence/i18n/de.po new file mode 100644 index 000000000000..830b782b1ee4 --- /dev/null +++ b/stock_picking_line_sequence/i18n/de.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +#, fuzzy +msgid "HiddenSequence" +msgstr "Reihenfolge" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "Reihenfolge" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Lagerbuchung" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Lieferung vornehmen" diff --git a/stock_picking_line_sequence/i18n/es.po b/stock_picking_line_sequence/i18n/es.po new file mode 100644 index 000000000000..6f18d701d7e4 --- /dev/null +++ b/stock_picking_line_sequence/i18n/es.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +#, fuzzy +msgid "HiddenSequence" +msgstr "Secuencia" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "Secuencia" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de existencias" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Transferir" diff --git a/stock_picking_line_sequence/i18n/es_MX.po b/stock_picking_line_sequence/i18n/es_MX.po new file mode 100644 index 000000000000..81e27fa9bad7 --- /dev/null +++ b/stock_picking_line_sequence/i18n/es_MX.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" +"es_MX/)\n" +"Language: es_MX\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Movimiento bursátil" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_line_sequence/i18n/fi.po b/stock_picking_line_sequence/i18n/fi.po new file mode 100644 index 000000000000..0c200fd67ba8 --- /dev/null +++ b/stock_picking_line_sequence/i18n/fi.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Varastosiirto" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_line_sequence/i18n/fr.po b/stock_picking_line_sequence/i18n/fr.po new file mode 100644 index 000000000000..4fe9e4c7fbb9 --- /dev/null +++ b/stock_picking_line_sequence/i18n/fr.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +#, fuzzy +msgid "HiddenSequence" +msgstr "Séquence" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "Séquence" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Mouvement de stock" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Transfert" diff --git a/stock_picking_line_sequence/i18n/hr.po b/stock_picking_line_sequence/i18n/hr.po new file mode 100644 index 000000000000..2cbf4a9c246d --- /dev/null +++ b/stock_picking_line_sequence/i18n/hr.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +# Bole , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-28 03:51+0000\n" +"PO-Revision-Date: 2018-02-28 03:51+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +#, fuzzy +msgid "HiddenSequence" +msgstr "Sekvenca" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "Makimalni broj redaka" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "Sekvenca" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "Prikazuje sekvencu na skladišnom prenosu." + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Skladišni prenos" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Prenos" diff --git a/stock_picking_line_sequence/i18n/it.po b/stock_picking_line_sequence/i18n/it.po new file mode 100644 index 000000000000..3a7b76bd0514 --- /dev/null +++ b/stock_picking_line_sequence/i18n/it.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Movimento di magazzino" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Trasferisci" diff --git a/stock_picking_line_sequence/i18n/nl_NL.po b/stock_picking_line_sequence/i18n/nl_NL.po new file mode 100644 index 000000000000..0bdd1f4e3ca8 --- /dev/null +++ b/stock_picking_line_sequence/i18n/nl_NL.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +#, fuzzy +msgid "HiddenSequence" +msgstr "Volgorde" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "Volgorde" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Voorraadmutatie" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Verplaats" diff --git a/stock_picking_line_sequence/i18n/pt.po b/stock_picking_line_sequence/i18n/pt.po new file mode 100644 index 000000000000..8e4394460200 --- /dev/null +++ b/stock_picking_line_sequence/i18n/pt.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +# Pedro Castro Silva , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-18 03:48+0000\n" +"PO-Revision-Date: 2017-12-18 03:48+0000\n" +"Last-Translator: Pedro Castro Silva , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Movimento Stock" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Transferência" diff --git a/stock_picking_line_sequence/i18n/pt_BR.po b/stock_picking_line_sequence/i18n/pt_BR.po new file mode 100644 index 000000000000..e61629d7dce4 --- /dev/null +++ b/stock_picking_line_sequence/i18n/pt_BR.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2020-06-23 03:19+0000\n" +"Last-Translator: Fernando Colus \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" +"23907/pt_BR/)\n" +"Language: pt_BR\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 3.10\n" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "Sequência" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "Ocultar Sequência" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "Sequência máxima em linhas" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "Sequência" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "Exibe a sequência na movimentação de estoque." + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Movimentação de estoque" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Transferência" diff --git a/stock_picking_line_sequence/i18n/sl.po b/stock_picking_line_sequence/i18n/sl.po new file mode 100644 index 000000000000..0ef4680498e0 --- /dev/null +++ b/stock_picking_line_sequence/i18n/sl.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2020-08-08 16:59+0000\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 3.10\n" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "Zap." + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "Skrito zaporedje" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "Maks. zaporedje v vrsticah" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "Zaporedje" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "Prikaže zaporedje pri premikih zaloge." + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Premik zaloge" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "Premestitev" diff --git a/stock_picking_line_sequence/i18n/stock_picking_line_sequence.pot b/stock_picking_line_sequence/i18n/stock_picking_line_sequence.pot new file mode 100644 index 000000000000..eed3a24990ae --- /dev/null +++ b/stock_picking_line_sequence/i18n/stock_picking_line_sequence.pot @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "" + diff --git a/stock_picking_line_sequence/i18n/tr.po b/stock_picking_line_sequence/i18n/tr.po new file mode 100644 index 000000000000..35866dad6173 --- /dev/null +++ b/stock_picking_line_sequence/i18n/tr.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\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" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Stok Taşı" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_line_sequence/i18n/tr_TR.po b/stock_picking_line_sequence/i18n/tr_TR.po new file mode 100644 index 000000000000..0139b58d2b3a --- /dev/null +++ b/stock_picking_line_sequence/i18n/tr_TR.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_line_sequence +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:56+0000\n" +"PO-Revision-Date: 2017-12-03 03:56+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: stock_picking_line_sequence +#: model_terms:ir.ui.view,arch_db:stock_picking_line_sequence.report_delivery_document +msgid "Seq." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence +msgid "HiddenSequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_picking__max_line_sequence +msgid "Max sequence in lines" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,field_description:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Sequence" +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model.fields,help:stock_picking_line_sequence.field_stock_move__sequence2 +msgid "Shows the sequence in the Stock Move." +msgstr "" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_move +msgid "Stock Move" +msgstr "Stok hareketi" + +#. module: stock_picking_line_sequence +#: model:ir.model,name:stock_picking_line_sequence.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_line_sequence/init_hooks.py b/stock_picking_line_sequence/init_hooks.py new file mode 100644 index 000000000000..07ead605b3d3 --- /dev/null +++ b/stock_picking_line_sequence/init_hooks.py @@ -0,0 +1,15 @@ +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2017 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import SUPERUSER_ID +from odoo.api import Environment + + +def post_init_hook(cr, pool): + """ + Fetches all the pickings and resets the sequence of the move lines + """ + env = Environment(cr, SUPERUSER_ID, {}) + stock = env["stock.picking"].search([]) + stock.with_context(skip_update_line_ids=True)._reset_sequence() diff --git a/stock_picking_line_sequence/models/__init__.py b/stock_picking_line_sequence/models/__init__.py new file mode 100644 index 000000000000..fe66b785addd --- /dev/null +++ b/stock_picking_line_sequence/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import stock diff --git a/stock_picking_line_sequence/models/stock.py b/stock_picking_line_sequence/models/stock.py new file mode 100644 index 000000000000..9ea843d26fa4 --- /dev/null +++ b/stock_picking_line_sequence/models/stock.py @@ -0,0 +1,97 @@ +# Copyright 2017 Camptocamp SA - Damien Crier, Alexandre Fayolle +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2017 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class StockMove(models.Model): + _inherit = "stock.move" + + # re-defines the field to change the default + sequence = fields.Integer("HiddenSequence", default=9999) + + # displays sequence on the stock moves + sequence2 = fields.Integer( + "Sequence", + help="Shows the sequence in the Stock Move.", + related="sequence", + readonly=True, + store=True, + ) + + @api.model + def create(self, values): + move = super(StockMove, self).create(values) + # We do not reset the sequence if we are copying a complete picking + # or creating a backorder + if not self.env.context.get("keep_line_sequence", False): + move.picking_id._reset_sequence() + return move + + +class StockMoveLine(models.Model): + _inherit = "stock.move.line" + + def _get_aggregated_product_quantities(self, **kwargs): + aggregated_move_lines = super( + StockMoveLine, self + )._get_aggregated_product_quantities(**kwargs) + for move_line in self: + name = move_line.product_id.display_name + description = move_line.move_id.description_picking + if description == name or description == move_line.product_id.name: + description = False + uom = move_line.product_uom_id + line_key = ( + str(move_line.product_id.id) + + "_" + + name + + (description or "") + + "uom " + + str(uom.id) + ) + sequence2 = move_line.move_id.sequence2 + if line_key in aggregated_move_lines: + aggregated_move_lines[line_key]["sequence2"] = sequence2 + + return aggregated_move_lines + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + @api.depends("move_ids_without_package") + def _compute_max_line_sequence(self): + """Allow to know the highest sequence entered in move lines. + Then we add 1 to this value for the next sequence, this value is + passed to the context of the o2m field in the view. + So when we create new move line, the sequence is automatically + incremented by 1. (max_sequence + 1) + """ + for picking in self: + picking.max_line_sequence = ( + max(picking.mapped("move_ids_without_package.sequence") or [0]) + 1 + ) + + max_line_sequence = fields.Integer( + string="Max sequence in lines", compute="_compute_max_line_sequence" + ) + + def _reset_sequence(self): + for rec in self: + current_sequence = 1 + for line in rec.move_ids_without_package: + line.sequence = current_sequence + current_sequence += 1 + + def copy(self, default=None): + return super(StockPicking, self.with_context(keep_line_sequence=True)).copy( + default + ) + + def button_validate(self): + return super( + StockPicking, self.with_context(keep_line_sequence=True) + ).button_validate() diff --git a/stock_picking_line_sequence/readme/CONTRIBUTORS.rst b/stock_picking_line_sequence/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..7f0c3d7e23d1 --- /dev/null +++ b/stock_picking_line_sequence/readme/CONTRIBUTORS.rst @@ -0,0 +1,6 @@ + +* Cécile Jallais +* Alexandre Fayolle +* Damien Crier +* Eficent Business and IT Consulting Services S.L. +* Serpent Consulting Services Pvt. Ltd. diff --git a/stock_picking_line_sequence/readme/DESCRIPTION.rst b/stock_picking_line_sequence/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..25838383c398 --- /dev/null +++ b/stock_picking_line_sequence/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ + +Provide a new field sequence on stock moves, which allows to manage the order of moves in a picking. + +For further information, please visit: + +* https://www.odoo.com/forum/help-1 diff --git a/stock_picking_line_sequence/readme/USAGE.rst b/stock_picking_line_sequence/readme/USAGE.rst new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stock_picking_line_sequence/report/report_deliveryslip.xml b/stock_picking_line_sequence/report/report_deliveryslip.xml new file mode 100644 index 000000000000..f70a7c932842 --- /dev/null +++ b/stock_picking_line_sequence/report/report_deliveryslip.xml @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/stock_picking_line_sequence/static/description/icon.png b/stock_picking_line_sequence/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/stock_picking_line_sequence/static/description/icon.png differ diff --git a/stock_picking_line_sequence/static/description/index.html b/stock_picking_line_sequence/static/description/index.html new file mode 100644 index 000000000000..94cdf2d2a6aa --- /dev/null +++ b/stock_picking_line_sequence/static/description/index.html @@ -0,0 +1,428 @@ + + + + + + +Stock picking lines with sequence number + + + +
+

Stock picking lines with sequence number

+ + +

Beta License: AGPL-3 OCA/stock-logistics-workflow Translate me on Weblate Try me on Runbot

+

Provide a new field sequence on stock moves, which allows to manage the order of moves in a picking.

+

For further information, please visit:

+ +

Table of contents

+ +
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
  • Eficent
  • +
  • Serpent CS
  • +
+
+
+

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.

+

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_line_sequence/tests/__init__.py b/stock_picking_line_sequence/tests/__init__.py new file mode 100644 index 000000000000..63659fda78a7 --- /dev/null +++ b/stock_picking_line_sequence/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import test_move_lines_sequence diff --git a/stock_picking_line_sequence/tests/test_move_lines_sequence.py b/stock_picking_line_sequence/tests/test_move_lines_sequence.py new file mode 100644 index 000000000000..9be7fadaa42c --- /dev/null +++ b/stock_picking_line_sequence/tests/test_move_lines_sequence.py @@ -0,0 +1,129 @@ +# Copyright 2017 Camptocamp SA - Damien Crier, Alexandre Fayolle +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2017 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.tests import common + + +class TestStockMove(common.TransactionCase): + def setUp(self): + super(TestStockMove, self).setUp() + # Useful models + self.Picking = self.env["stock.picking"] + self.product_id_1 = self.env.ref("product.product_product_8") + self.product_id_2 = self.env.ref("product.product_product_11") + self.product_id_3 = self.env.ref("product.product_product_6") + self.picking_type_in = self.env.ref("stock.picking_type_in") + self.supplier_location = self.env.ref("stock.stock_location_suppliers") + self.customer_location = self.env.ref("stock.stock_location_customers") + + def _create_picking(self): + """Create a Picking.""" + picking = self.Picking.create( + { + "picking_type_id": self.picking_type_in.id, + "location_id": self.supplier_location.id, + "location_dest_id": self.customer_location.id, + "move_lines": [ + ( + 0, + 0, + { + "name": "move 1", + "product_id": self.product_id_1.id, + "product_uom_qty": 5.0, + "product_uom": self.product_id_1.uom_id.id, + "location_id": self.supplier_location.id, + "location_dest_id": self.customer_location.id, + }, + ), + ( + 0, + 0, + { + "name": "move 2", + "product_id": self.product_id_2.id, + "product_uom_qty": 5.0, + "product_uom": self.product_id_2.uom_id.id, + "location_id": self.supplier_location.id, + "location_dest_id": self.customer_location.id, + }, + ), + ( + 0, + 0, + { + "name": "move 3", + "product_id": self.product_id_3.id, + "product_uom_qty": 5.0, + "product_uom": self.product_id_3.uom_id.id, + "location_id": self.supplier_location.id, + "location_dest_id": self.customer_location.id, + }, + ), + ], + } + ) + return picking + + def test_move_lines_sequence(self): + + self.picking = self._create_picking() + self.picking._compute_max_line_sequence() + self.picking.move_lines.write({"product_uom_qty": 10.0}) + self.picking2 = self.picking.copy() + self.assertEqual( + self.picking2[0].move_lines[0].sequence, + self.picking.move_lines[0].sequence, + "The Sequence is not copied properly", + ) + self.assertEqual( + self.picking2[0].move_lines[1].sequence, + self.picking.move_lines[1].sequence, + "The Sequence is not copied properly", + ) + self.assertEqual( + self.picking2[0].move_lines[2].sequence, + self.picking.move_lines[2].sequence, + "The Sequence is not copied properly", + ) + + def test_backorder(self): + picking = self._create_picking() + picking._compute_max_line_sequence() + picking.action_confirm() + picking.action_assign() + picking.move_line_ids[1].write({"qty_done": 5}) + res_dict = picking.button_validate() + self.assertEqual(res_dict["res_model"], "stock.backorder.confirmation") + backorder_wiz = ( + self.env["stock.backorder.confirmation"] + .browse(res_dict.get("res_id")) + .with_context(res_dict["context"]) + ) + backorder_wiz.process() + picking_backorder = self.Picking.search([("backorder_id", "=", picking.id)]) + self.assertEqual( + picking_backorder[0].move_lines[1].sequence, 3, "Backorder wrong sequence" + ) + self.assertEqual( + picking_backorder[0].move_lines[0].sequence, 1, "Backorder wrong sequence" + ) + + def test_move_lines_aggregated(self): + picking = self._create_picking() + picking._compute_max_line_sequence() + picking.action_confirm() + agg_mls = picking.move_line_ids[0]._get_aggregated_product_quantities() + for key in agg_mls: + self.assertNotEqual( + agg_mls[key].get("sequence2", "NA"), + "NA", + "The field sequence2 is not added in dictionary", + ) + self.assertEqual( + picking.move_line_ids[0].move_id.sequence2, + agg_mls[key]["sequence2"], + "The Sequence is not copied properly in the aggregated move lines", + ) diff --git a/stock_picking_line_sequence/views/stock_view.xml b/stock_picking_line_sequence/views/stock_view.xml new file mode 100644 index 000000000000..540cff6360e0 --- /dev/null +++ b/stock_picking_line_sequence/views/stock_view.xml @@ -0,0 +1,38 @@ + + + + + stock.picking.form + stock.picking + + + + + + + + + + + + {'picking_type_code': picking_type_code, 'default_picking_id': id, + 'form_view_ref':'stock.view_move_picking_form', 'address_in_id': partner_id, + 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, + 'default_location_dest_id': location_dest_id, 'default_sequence': max_line_sequence} + + + + + +