diff --git a/stock_picking_show_return/README.rst b/stock_picking_show_return/README.rst new file mode 100644 index 000000000000..b88a7aa9b7f9 --- /dev/null +++ b/stock_picking_show_return/README.rst @@ -0,0 +1,106 @@ +============================== +Show returns on stock pickings +============================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/14.0/stock_picking_show_return + :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-14.0/stock-logistics-workflow-14.0-stock_picking_show_return + :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/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds one tab in the pickings form view to display the returns +pickings related to the current one. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To display returned pickings from this one +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. Go to any picking that has a return +#. See the new tab "Returns" appears. + +To display origin picking from any returned picking +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. Go to any returned picking +#. See the new smart button "Origin picking" appears. +#. Click on button to open origin picking. + +Changelog +========= + +12.0.1.0.1 (2020-01-30) +~~~~~~~~~~~~~~~~~~~~~~~ + +* [ADD] Display source picking from any returned picking. + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Pedro M. Baeza + * Sergio Teruel + +* `BizzAppDev `_: + + * Shruti Singh + * Ruchir Shukla + +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_show_return/__init__.py b/stock_picking_show_return/__init__.py new file mode 100644 index 000000000000..69f7babdfb1a --- /dev/null +++ b/stock_picking_show_return/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/stock_picking_show_return/__manifest__.py b/stock_picking_show_return/__manifest__.py new file mode 100644 index 000000000000..ffdbb9aed98e --- /dev/null +++ b/stock_picking_show_return/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2014-2017 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Show returns on stock pickings", + "version": "14.0.1.0.0", + "author": "Tecnativa, " "Odoo Community Association (OCA)", + "category": "Warehouse Management", + "website": "https://github.com/OCA/stock-logistics-workflow", + "license": "AGPL-3", + "depends": ["stock"], + "data": ["views/stock_picking_view.xml"], + "installable": True, +} diff --git a/stock_picking_show_return/i18n/de.po b/stock_picking_show_return/i18n/de.po new file mode 100644 index 000000000000..9f81ac328a2a --- /dev/null +++ b/stock_picking_show_return/i18n/de.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-23 11:56+0000\n" +"PO-Revision-Date: 2017-01-23 11: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_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "Lieferung vornehmen" diff --git a/stock_picking_show_return/i18n/es.po b/stock_picking_show_return/i18n/es.po new file mode 100644 index 000000000000..e681260a124c --- /dev/null +++ b/stock_picking_show_return/i18n/es.po @@ -0,0 +1,56 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-08-17 03:17+0000\n" +"PO-Revision-Date: 2021-08-17 03:17+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_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__id +msgid "ID" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "Albaranes devueltos" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "Devoluciones" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "Albarán origen" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "Transferir" diff --git a/stock_picking_show_return/i18n/fr.po b/stock_picking_show_return/i18n/fr.po new file mode 100644 index 000000000000..ae6e07550733 --- /dev/null +++ b/stock_picking_show_return/i18n/fr.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-23 11:56+0000\n" +"PO-Revision-Date: 2017-01-23 11: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_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "Transfert" diff --git a/stock_picking_show_return/i18n/it.po b/stock_picking_show_return/i18n/it.po new file mode 100644 index 000000000000..f227d19972e6 --- /dev/null +++ b/stock_picking_show_return/i18n/it.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +# Translators: +# Paolo Valier , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-23 11:56+0000\n" +"PO-Revision-Date: 2017-01-23 11:56+0000\n" +"Last-Translator: Paolo Valier , 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_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "Trasferisci" diff --git a/stock_picking_show_return/i18n/nl_NL.po b/stock_picking_show_return/i18n/nl_NL.po new file mode 100644 index 000000000000..1f1d132623cf --- /dev/null +++ b/stock_picking_show_return/i18n/nl_NL.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "Retouren" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "Verplaats" diff --git a/stock_picking_show_return/i18n/pt.po b/stock_picking_show_return/i18n/pt.po new file mode 100644 index 000000000000..419440b9b152 --- /dev/null +++ b/stock_picking_show_return/i18n/pt.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +# Translators: +# Pedro Castro Silva , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "Transferência" diff --git a/stock_picking_show_return/i18n/pt_BR.po b/stock_picking_show_return/i18n/pt_BR.po new file mode 100644 index 000000000000..b05d68efa960 --- /dev/null +++ b/stock_picking_show_return/i18n/pt_BR.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-23 11:56+0000\n" +"PO-Revision-Date: 2017-01-23 11:56+0000\n" +"Last-Translator: OCA Transbot , 2017\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" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "Transferir" diff --git a/stock_picking_show_return/i18n/sl.po b/stock_picking_show_return/i18n/sl.po new file mode 100644 index 000000000000..ea28f5c62ecb --- /dev/null +++ b/stock_picking_show_return/i18n/sl.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-23 11:56+0000\n" +"PO-Revision-Date: 2017-01-23 11:56+0000\n" +"Last-Translator: OCA Transbot , 2017\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" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "Povrnjeni zbirniki" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "Vračila" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +#, fuzzy +msgid "Source picking" +msgstr "Povrnjeni zbirniki" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_show_return/i18n/stock_picking_show_return.pot b/stock_picking_show_return/i18n/stock_picking_show_return.pot new file mode 100644 index 000000000000..7bdefa1e4d14 --- /dev/null +++ b/stock_picking_show_return/i18n/stock_picking_show_return.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_picking_show_return/i18n/zh_CN.po b/stock_picking_show_return/i18n/zh_CN.po new file mode 100644 index 000000000000..9ecdfef964de --- /dev/null +++ b/stock_picking_show_return/i18n/zh_CN.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_show_return +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-05-02 13:19+0000\n" +"Last-Translator: Dong \n" +"Language-Team: none\n" +"Language: zh_CN\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" +"X-Generator: Weblate 3.10\n" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Source picking" +msgstr "来源调拨单" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__returned_ids +msgid "Returned pickings" +msgstr "已退货调拨单" + +#. module: stock_picking_show_return +#: model_terms:ir.ui.view,arch_db:stock_picking_show_return.view_picking_form +msgid "Returns" +msgstr "退货" + +#. module: stock_picking_show_return +#: model:ir.model.fields,field_description:stock_picking_show_return.field_stock_picking__source_picking_id +msgid "Source picking" +msgstr "来源调拨单" + +#. module: stock_picking_show_return +#: model:ir.model,name:stock_picking_show_return.model_stock_picking +msgid "Transfer" +msgstr "调拨" diff --git a/stock_picking_show_return/models/__init__.py b/stock_picking_show_return/models/__init__.py new file mode 100644 index 000000000000..d2fe3ff3ac24 --- /dev/null +++ b/stock_picking_show_return/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import stock_picking diff --git a/stock_picking_show_return/models/stock_picking.py b/stock_picking_show_return/models/stock_picking.py new file mode 100644 index 000000000000..530d52931574 --- /dev/null +++ b/stock_picking_show_return/models/stock_picking.py @@ -0,0 +1,39 @@ +# Copyright 2014-2017 Pedro M. Baeza +# Copyright 2018-2019 Sergio Teruel +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models +from odoo.fields import first + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + returned_ids = fields.Many2many( + comodel_name="stock.picking", + compute="_compute_returned_ids", + string="Returned pickings", + ) + source_picking_id = fields.Many2one( + comodel_name="stock.picking", + compute="_compute_source_picking_id", + string="Source picking", + ) + + def _compute_returned_ids(self): + for picking in self: + picking.returned_ids = picking.mapped( + "move_lines.returned_move_ids.picking_id" + ) + + @api.depends("move_lines.origin_returned_move_id") + def _compute_source_picking_id(self): + """Get source piking from this picking. Only one origin is possible.""" + for picking in self: + picking.source_picking_id = first( + picking.mapped("move_lines.origin_returned_move_id.picking_id") + ) + + def action_show_source_picking(self): + """ Open source picking form action """ + return self.source_picking_id.get_formview_action() diff --git a/stock_picking_show_return/readme/CONTRIBUTORS.rst b/stock_picking_show_return/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..805a10ed1b6f --- /dev/null +++ b/stock_picking_show_return/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* `Tecnativa `_: + + * Pedro M. Baeza + * Sergio Teruel + +* `BizzAppDev `_: + + * Shruti Singh + * Ruchir Shukla diff --git a/stock_picking_show_return/readme/DESCRIPTION.rst b/stock_picking_show_return/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..9500a4c0f53f --- /dev/null +++ b/stock_picking_show_return/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds one tab in the pickings form view to display the returns +pickings related to the current one. diff --git a/stock_picking_show_return/readme/HISTORY.rst b/stock_picking_show_return/readme/HISTORY.rst new file mode 100644 index 000000000000..345e4fc978f1 --- /dev/null +++ b/stock_picking_show_return/readme/HISTORY.rst @@ -0,0 +1,4 @@ +12.0.1.0.1 (2020-01-30) +~~~~~~~~~~~~~~~~~~~~~~~ + +* [ADD] Display source picking from any returned picking. diff --git a/stock_picking_show_return/readme/USAGE.rst b/stock_picking_show_return/readme/USAGE.rst new file mode 100644 index 000000000000..b59487f08637 --- /dev/null +++ b/stock_picking_show_return/readme/USAGE.rst @@ -0,0 +1,12 @@ +To display returned pickings from this one +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. Go to any picking that has a return +#. See the new tab "Returns" appears. + +To display origin picking from any returned picking +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +#. Go to any returned picking +#. See the new smart button "Origin picking" appears. +#. Click on button to open origin picking. diff --git a/stock_picking_show_return/static/description/icon.png b/stock_picking_show_return/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/stock_picking_show_return/static/description/icon.png differ diff --git a/stock_picking_show_return/static/description/index.html b/stock_picking_show_return/static/description/index.html new file mode 100644 index 000000000000..4810ea7e952e --- /dev/null +++ b/stock_picking_show_return/static/description/index.html @@ -0,0 +1,471 @@ + + + + + + +Show returns on stock pickings + + + +
+

Show returns on stock pickings

+ + +

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

+

This module adds one tab in the pickings form view to display the returns +pickings related to the current one.

+

Table of contents

+ +
+

Usage

+
+

To display returned pickings from this one

+
    +
  1. Go to any picking that has a return
  2. +
  3. See the new tab “Returns” appears.
  4. +
+
+
+

To display origin picking from any returned picking

+
    +
  1. Go to any returned picking
  2. +
  3. See the new smart button “Origin picking” appears.
  4. +
  5. Click on button to open origin picking.
  6. +
+
+
+
+

Changelog

+
+

12.0.1.0.1 (2020-01-30)

+
    +
  • [ADD] Display source picking from any returned picking.
  • +
+
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

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_show_return/tests/__init__.py b/stock_picking_show_return/tests/__init__.py new file mode 100644 index 000000000000..82d5e07f437a --- /dev/null +++ b/stock_picking_show_return/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_stock_picking_show_return diff --git a/stock_picking_show_return/tests/test_stock_picking_show_return.py b/stock_picking_show_return/tests/test_stock_picking_show_return.py new file mode 100644 index 000000000000..f5af2e461e6c --- /dev/null +++ b/stock_picking_show_return/tests/test_stock_picking_show_return.py @@ -0,0 +1,73 @@ +# Copyright 2014-2017 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase, tagged + + +@tagged("post_install", "-at_install") +class TestStockPickingShowReturn(TransactionCase): + def setUp(self): + super(TestStockPickingShowReturn, self).setUp() + self.product = self.env["product.product"].create({"name": "Test product"}) + picking_type = self.env.ref("stock.picking_type_internal") + self.picking = self.env["stock.picking"].create( + { + "picking_type_id": picking_type.id, + "location_id": picking_type.default_location_src_id.id, + "location_dest_id": picking_type.default_location_dest_id.id, + "move_lines": [ + ( + 0, + 0, + { + "name": self.product.name, + "product_id": self.product.id, + "product_uom": self.product.uom_id.id, + "product_uom_qty": 1, + }, + ) + ], + } + ) + + def test_returned_ids_field(self): + self.picking.action_assign() + self.picking.move_line_ids.qty_done = 1 + self.picking._action_done() + wizard = ( + self.env["stock.return.picking"] + .with_context( + active_ids=self.picking.ids, + active_id=self.picking.id, + active_model="stock.picking", + ) + .create({}) + ) + wizard._onchange_picking_id() + wizard.create_returns() + self.picking._compute_returned_ids() + self.assertTrue(self.picking.returned_ids) + + def test_source_picking_id_field(self): + self.picking.action_assign() + self.picking.move_line_ids.qty_done = 1 + self.picking._action_done() + wizard = ( + self.env["stock.return.picking"] + .with_context( + active_ids=self.picking.ids, + active_id=self.picking.id, + active_model="stock.picking", + ) + .create({}) + ) + wizard._onchange_picking_id() + wizard.create_returns() + self.picking._compute_returned_ids() + picking_returned = self.picking.returned_ids[0] + # Get first picking returned to check if origin is self.picking + picking_origin = picking_returned.source_picking_id + self.assertEqual(picking_origin, self.picking) + # Open origin returned picking form view + action = picking_returned.action_show_source_picking() + self.assertEqual(action["res_id"], self.picking.id) diff --git a/stock_picking_show_return/views/stock_picking_view.xml b/stock_picking_show_return/views/stock_picking_view.xml new file mode 100644 index 000000000000..e275dc281e0e --- /dev/null +++ b/stock_picking_show_return/views/stock_picking_view.xml @@ -0,0 +1,31 @@ + + + + stock.picking + + + + + + + + +
+ +
+
+
+