From 89e72dc76c0d18bbbba81fa8cb83fa384c9f4cf8 Mon Sep 17 00:00:00 2001 From: sergio-teruel Date: Tue, 8 Nov 2022 21:45:12 +0100 Subject: [PATCH] [MIG] stock_picking_product_availability_inline: Migration to v15.0 --- .../stock_picking_product_availability_inline | 1 + .../setup.py | 6 ++++++ .../README.rst | 10 +++++----- .../__manifest__.py | 4 ++-- .../models/stock_picking.py | 8 ++++---- .../static/description/index.html | 6 +++--- ..._stock_picking_product_availability_inline.py | 4 ++-- .../views/stock_move_line_views.xml | 16 ++++++---------- .../views/stock_picking_views.xml | 16 ++++++---------- 9 files changed, 35 insertions(+), 36 deletions(-) create mode 120000 setup/stock_picking_product_availability_inline/odoo/addons/stock_picking_product_availability_inline create mode 100644 setup/stock_picking_product_availability_inline/setup.py diff --git a/setup/stock_picking_product_availability_inline/odoo/addons/stock_picking_product_availability_inline b/setup/stock_picking_product_availability_inline/odoo/addons/stock_picking_product_availability_inline new file mode 120000 index 000000000000..8415558ce053 --- /dev/null +++ b/setup/stock_picking_product_availability_inline/odoo/addons/stock_picking_product_availability_inline @@ -0,0 +1 @@ +../../../../stock_picking_product_availability_inline \ No newline at end of file diff --git a/setup/stock_picking_product_availability_inline/setup.py b/setup/stock_picking_product_availability_inline/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/stock_picking_product_availability_inline/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_picking_product_availability_inline/README.rst b/stock_picking_product_availability_inline/README.rst index c152bd278a66..f72afb947bca 100644 --- a/stock_picking_product_availability_inline/README.rst +++ b/stock_picking_product_availability_inline/README.rst @@ -14,13 +14,13 @@ Stock Picking Product Availability Inline :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/13.0/stock_picking_product_availability_inline + :target: https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_product_availability_inline :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-13-0/stock-logistics-workflow-13-0-stock_picking_product_availability_inline + :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_product_availability_inline :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/13.0 + :target: https://runbot.odoo-community.org/runbot/154/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -51,7 +51,7 @@ 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -84,6 +84,6 @@ 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. +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_product_availability_inline/__manifest__.py b/stock_picking_product_availability_inline/__manifest__.py index d46a0362479b..0b33fbb8d0d0 100644 --- a/stock_picking_product_availability_inline/__manifest__.py +++ b/stock_picking_product_availability_inline/__manifest__.py @@ -3,12 +3,12 @@ { "name": "Stock Picking Product Availability Inline", "summary": "Show product availability in product drop-down in stock picking form view.", - "version": "13.0.1.1.1", + "version": "15.0.1.0.0", "development_status": "Beta", "category": "Warehouse Management", "website": "https://github.com/OCA/stock-logistics-workflow", "author": "Tecnativa, Odoo Community Association (OCA)", "license": "AGPL-3", - "depends": ["stock", "base_view_inheritance_extension"], + "depends": ["stock"], "data": ["views/stock_picking_views.xml", "views/stock_move_line_views.xml"], } diff --git a/stock_picking_product_availability_inline/models/stock_picking.py b/stock_picking_product_availability_inline/models/stock_picking.py index d3c325cb3b62..96afb6770181 100644 --- a/stock_picking_product_availability_inline/models/stock_picking.py +++ b/stock_picking_product_availability_inline/models/stock_picking.py @@ -18,7 +18,7 @@ class StockMove(models.Model): _inherit = "stock.move" @api.onchange("product_id") - def onchange_product_id(self): + def _onchange_product_id(self): """Avoid calling product name_get method several times with 'sp_product_stock_inline' context key. """ @@ -27,7 +27,7 @@ def onchange_product_id(self): sp_line = self.with_context( sp_product_stock_inline=False, warehouse=self.warehouse_id.id ) - return super(StockMove, sp_line).onchange_product_id() + return super(StockMove, sp_line)._onchange_product_id() class StockMoveLine(models.Model): @@ -40,7 +40,7 @@ class StockMoveLine(models.Model): ) @api.onchange("product_id") - def onchange_product_id(self): + def _onchange_product_id(self): """Avoid calling product name_get method several times with 'sp_product_stock_inline' context key. """ @@ -50,4 +50,4 @@ def onchange_product_id(self): sp_product_stock_inline=False, warehouse=self.picking_type_warehouse_id.id, ) - return super(StockMoveLine, sp_line).onchange_product_id() + return super(StockMoveLine, sp_line)._onchange_product_id() diff --git a/stock_picking_product_availability_inline/static/description/index.html b/stock_picking_product_availability_inline/static/description/index.html index 2d38e58da22f..762888eafe87 100644 --- a/stock_picking_product_availability_inline/static/description/index.html +++ b/stock_picking_product_availability_inline/static/description/index.html @@ -367,7 +367,7 @@

Stock Picking Product Availability Inline

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module extends the functionality of ‘Warehouse Management’ to show you the stock availability (Free To Use Quantity) of each product as part of its name in the product drop-down widget on stock picking.

@@ -400,7 +400,7 @@

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.

+feedback.

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

@@ -428,7 +428,7 @@

Maintainers

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.

+

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_product_availability_inline/tests/test_stock_picking_product_availability_inline.py b/stock_picking_product_availability_inline/tests/test_stock_picking_product_availability_inline.py index 1e203e6f828f..8fbbf302e299 100644 --- a/stock_picking_product_availability_inline/tests/test_stock_picking_product_availability_inline.py +++ b/stock_picking_product_availability_inline/tests/test_stock_picking_product_availability_inline.py @@ -1,11 +1,11 @@ # Copyright 2022 Tecnativa - Ernesto Tejeda # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests import Form, SavepointCase, tagged +from odoo.tests import Form, TransactionCase, tagged @tagged("post_install", "-at_install") -class TestStockPickingProductAvailabilityInline(SavepointCase): +class TestStockPickingProductAvailabilityInline(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() diff --git a/stock_picking_product_availability_inline/views/stock_move_line_views.xml b/stock_picking_product_availability_inline/views/stock_move_line_views.xml index 57e2935325c5..3ead3edd7781 100644 --- a/stock_picking_product_availability_inline/views/stock_move_line_views.xml +++ b/stock_picking_product_availability_inline/views/stock_move_line_views.xml @@ -13,16 +13,12 @@ - True - picking_type_warehouse_id + + { + "sp_product_stock_inline": True, + "warehouse": picking_type_warehouse_id + } + diff --git a/stock_picking_product_availability_inline/views/stock_picking_views.xml b/stock_picking_product_availability_inline/views/stock_picking_views.xml index 5017fa74576f..9a447499f107 100644 --- a/stock_picking_product_availability_inline/views/stock_picking_views.xml +++ b/stock_picking_product_availability_inline/views/stock_picking_views.xml @@ -13,16 +13,12 @@ expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']" position="attributes" > - True - parent.picking_type_warehouse_id + + { + "sp_product_stock_inline": True, + "warehouse": parent.picking_type_warehouse_id + } +