diff --git a/product_supplierinfo_for_customer_picking/README.rst b/product_supplierinfo_for_customer_picking/README.rst new file mode 100644 index 000000000000..8fb40ec86550 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/README.rst @@ -0,0 +1,78 @@ +========================================= +Product Supplierinfo For Customer Picking +========================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/product_supplierinfo_for_customer_picking + :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-product_supplierinfo_for_customer_picking + :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| + +Based on product_supplierinfo_for_customer, this module loads in every Stock move the +customer code defined in the product. + +**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 +~~~~~~~ + +* Agile Business Group + +Contributors +~~~~~~~~~~~~ + +* Nicola Malcontenti +* Alex Comba +* Lorenzo Battistini +* Serpent Consulting Services Pvt. Ltd. +* Aaron Henriquez + +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/product_supplierinfo_for_customer_picking/__init__.py b/product_supplierinfo_for_customer_picking/__init__.py new file mode 100644 index 000000000000..cb45f2710a7e --- /dev/null +++ b/product_supplierinfo_for_customer_picking/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import models diff --git a/product_supplierinfo_for_customer_picking/__manifest__.py b/product_supplierinfo_for_customer_picking/__manifest__.py new file mode 100644 index 000000000000..de2d097dba31 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2013 - 2021 Agile Business Group sagl () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Product Supplierinfo For Customer Picking", + "version": "15.0.1.0.0", + "author": "Agile Business Group, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-workflow", + "category": "Stock", + "summary": "This module makes the product customer code visible " + "in the stock moves of a picking.", + "license": "AGPL-3", + "depends": ["stock", "product_supplierinfo_for_customer"], + "data": [ + "views/stock_picking_view.xml", + ], + "installable": True, +} diff --git a/product_supplierinfo_for_customer_picking/i18n/de.po b/product_supplierinfo_for_customer_picking/i18n/de.po new file mode 100644 index 000000000000..a907bd55dbab --- /dev/null +++ b/product_supplierinfo_for_customer_picking/i18n/de.po @@ -0,0 +1,30 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_customer_code_picking +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-15 14:28+0000\n" +"PO-Revision-Date: 2015-01-31 14:51+0100\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_picking.field_stock_move__product_customer_code +msgid "Product Customer Code" +msgstr "Artikelnummer beim Kunden" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model,name:product_supplierinfo_for_customer_picking.model_stock_move +msgid "Stock Move" +msgstr "Lagerbewegung" + +#~ msgid "Picking List" +#~ msgstr "Kommissionierschein" diff --git a/product_supplierinfo_for_customer_picking/i18n/it.po b/product_supplierinfo_for_customer_picking/i18n/it.po new file mode 100644 index 000000000000..de208a63103e --- /dev/null +++ b/product_supplierinfo_for_customer_picking/i18n/it.po @@ -0,0 +1,31 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_customer_code_picking +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-01-15 14:28+0000\n" +"PO-Revision-Date: 2014-01-15 15:29+0100\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 1.6.2\n" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_picking.field_stock_move__product_customer_code +msgid "Product Customer Code" +msgstr "Codice Prodotto Cliente" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model,name:product_supplierinfo_for_customer_picking.model_stock_move +msgid "Stock Move" +msgstr "Movimento di magazzino" + +#~ msgid "Picking List" +#~ msgstr "Documento di trasporto" diff --git a/product_supplierinfo_for_customer_picking/i18n/product_supplierinfo_for_customer_picking.pot b/product_supplierinfo_for_customer_picking/i18n/product_supplierinfo_for_customer_picking.pot new file mode 100644 index 000000000000..912bde6cb96d --- /dev/null +++ b/product_supplierinfo_for_customer_picking/i18n/product_supplierinfo_for_customer_picking.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_supplierinfo_for_customer_picking +# +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: product_supplierinfo_for_customer_picking +#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_picking.field_stock_move__display_name +msgid "Display Name" +msgstr "" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_picking.field_stock_move__id +msgid "ID" +msgstr "" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_picking.field_stock_move____last_update +msgid "Last Modified on" +msgstr "" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_picking.field_stock_move__product_customer_code +msgid "Product Customer Code" +msgstr "" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model,name:product_supplierinfo_for_customer_picking.model_stock_move +msgid "Stock Move" +msgstr "" diff --git a/product_supplierinfo_for_customer_picking/i18n/pt_BR.po b/product_supplierinfo_for_customer_picking/i18n/pt_BR.po new file mode 100644 index 000000000000..22a2695becd1 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/i18n/pt_BR.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_supplierinfo_for_customer_picking +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-06-23 03:19+0000\n" +"Last-Translator: Fernando Colus \n" +"Language-Team: none\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: product_supplierinfo_for_customer_picking +#: model:ir.model.fields,field_description:product_supplierinfo_for_customer_picking.field_stock_move__product_customer_code +msgid "Product Customer Code" +msgstr "Código do Cliente do Produto" + +#. module: product_supplierinfo_for_customer_picking +#: model:ir.model,name:product_supplierinfo_for_customer_picking.model_stock_move +msgid "Stock Move" +msgstr "Movimentação de Estoque" diff --git a/product_supplierinfo_for_customer_picking/models/__init__.py b/product_supplierinfo_for_customer_picking/models/__init__.py new file mode 100644 index 000000000000..a31bf9fa1724 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/models/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import stock_move diff --git a/product_supplierinfo_for_customer_picking/models/stock_move.py b/product_supplierinfo_for_customer_picking/models/stock_move.py new file mode 100644 index 000000000000..68e7e86faa72 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/models/stock_move.py @@ -0,0 +1,28 @@ +# Copyright 2013 - 2021 Agile Business Group sagl () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from odoo import api, fields, models + + +class StockMove(models.Model): + _inherit = "stock.move" + + @api.depends( + "picking_id.partner_id", "product_id", "product_id.customer_ids.product_code" + ) + def _compute_product_customer_code(self): + for move in self: + product_customer_code = False + if ( + move.picking_id + and move.picking_id.partner_id + and move.product_tmpl_id.customer_ids + ): + customer = fields.first( + move.product_tmpl_id.customer_ids.filtered( + lambda m: move.picking_id.partner_id + ) + ) + product_customer_code = customer.product_code + move.product_customer_code = product_customer_code + + product_customer_code = fields.Char(compute="_compute_product_customer_code") diff --git a/product_supplierinfo_for_customer_picking/readme/CONTRIBUTORS.rst b/product_supplierinfo_for_customer_picking/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..c0fcdc080390 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Nicola Malcontenti +* Alex Comba +* Lorenzo Battistini +* Serpent Consulting Services Pvt. Ltd. +* Aaron Henriquez diff --git a/product_supplierinfo_for_customer_picking/readme/DESCRIPTION.rst b/product_supplierinfo_for_customer_picking/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..9a474220be34 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +Based on product_supplierinfo_for_customer, this module loads in every Stock move the +customer code defined in the product. diff --git a/product_supplierinfo_for_customer_picking/static/description/icon.png b/product_supplierinfo_for_customer_picking/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/product_supplierinfo_for_customer_picking/static/description/icon.png differ diff --git a/product_supplierinfo_for_customer_picking/static/description/index.html b/product_supplierinfo_for_customer_picking/static/description/index.html new file mode 100644 index 000000000000..1910a9c25544 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/static/description/index.html @@ -0,0 +1,424 @@ + + + + + + +Product Supplierinfo For Customer Picking + + + +
+

Product Supplierinfo For Customer Picking

+ + +

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

+

Based on product_supplierinfo_for_customer, this module loads in every Stock move the +customer code defined in the product.

+

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

+
    +
  • Agile Business Group
  • +
+
+
+

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/product_supplierinfo_for_customer_picking/tests/__init__.py b/product_supplierinfo_for_customer_picking/tests/__init__.py new file mode 100644 index 000000000000..926eff1cb9f3 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import test_product_supplierinfo_for_customer_picking diff --git a/product_supplierinfo_for_customer_picking/tests/test_product_supplierinfo_for_customer_picking.py b/product_supplierinfo_for_customer_picking/tests/test_product_supplierinfo_for_customer_picking.py new file mode 100644 index 000000000000..cbce300fab0c --- /dev/null +++ b/product_supplierinfo_for_customer_picking/tests/test_product_supplierinfo_for_customer_picking.py @@ -0,0 +1,51 @@ +# Copyright 2018 ForgeFlow +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestProductSupplierinfoForCustomerPicking(TransactionCase): + def setUp(self): + super(TestProductSupplierinfoForCustomerPicking, self).setUp() + self.src_location = self.env.ref("stock.stock_location_stock") + self.dest_location = self.env.ref("stock.stock_location_customers") + self.product = self.browse_ref("product.product_product_3") + self.partner = self.browse_ref("base.res_partner_2") + self.picking = self.env["stock.picking"].create( + { + "partner_id": self.partner.id, + "picking_type_id": self.env.ref("stock.picking_type_out").id, + "location_id": self.src_location.id, + "location_dest_id": self.dest_location.id, + } + ) + self.move = self.env["stock.move"].create( + { + "name": self.product.partner_ref, + "picking_id": self.picking.id, + "product_id": self.product.id, + "product_uom": self.product.uom_id.id, + "location_id": self.src_location.id, + "location_dest_id": self.dest_location.id, + "product_uom_qty": 1.0, + } + ) + self.product.write( + { + "customer_ids": [ + ( + 0, + 0, + { + "name": self.partner.id, + "product_code": "test_agrolait", + }, + ) + ], + } + ) + + def test_product_supplierinfo_for_customer_picking(self): + move = self.picking.move_lines[0] + move._compute_product_customer_code() + self.assertEqual(move.product_customer_code, "test_agrolait") diff --git a/product_supplierinfo_for_customer_picking/views/stock_picking_view.xml b/product_supplierinfo_for_customer_picking/views/stock_picking_view.xml new file mode 100644 index 000000000000..d57c14f03108 --- /dev/null +++ b/product_supplierinfo_for_customer_picking/views/stock_picking_view.xml @@ -0,0 +1,26 @@ + + + + + + stock.picking.form + stock.picking + + + + + + + + + + + + diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index 275829d9707e..a8aa7e886020 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -8,6 +8,7 @@ description="Meta package for oca-stock-logistics-workflow Odoo addons", version=version, install_requires=[ + 'odoo-addon-product_supplierinfo_for_customer_picking>=15.0dev,<15.1dev', 'odoo-addon-stock_no_negative>=15.0dev,<15.1dev', 'odoo-addon-stock_picking_back2draft>=15.0dev,<15.1dev', 'odoo-addon-stock_picking_filter_lot>=15.0dev,<15.1dev', diff --git a/setup/product_supplierinfo_for_customer_picking/odoo/addons/product_supplierinfo_for_customer_picking b/setup/product_supplierinfo_for_customer_picking/odoo/addons/product_supplierinfo_for_customer_picking new file mode 120000 index 000000000000..fb17c2cd9acb --- /dev/null +++ b/setup/product_supplierinfo_for_customer_picking/odoo/addons/product_supplierinfo_for_customer_picking @@ -0,0 +1 @@ +../../../../product_supplierinfo_for_customer_picking \ No newline at end of file diff --git a/setup/product_supplierinfo_for_customer_picking/setup.py b/setup/product_supplierinfo_for_customer_picking/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/product_supplierinfo_for_customer_picking/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)