diff --git a/stock_available_unreserved/__manifest__.py b/stock_available_unreserved/__manifest__.py index 4a83965e..07ef055c 100644 --- a/stock_available_unreserved/__manifest__.py +++ b/stock_available_unreserved/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Stock Available Unreserved", "summary": "Quantity of stock available for immediate use", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", "development_status": "Production/Stable", "maintainers": ["LoisRForgeFlow"], diff --git a/stock_available_unreserved/models/product_template.py b/stock_available_unreserved/models/product_template.py index 073b32c8..ed170a7a 100644 --- a/stock_available_unreserved/models/product_template.py +++ b/stock_available_unreserved/models/product_template.py @@ -2,7 +2,7 @@ # Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from odoo import api, fields, models +from odoo import _, api, fields, models class ProductTemplate(models.Model): @@ -32,7 +32,8 @@ def action_open_quants_unreserved(self): quant_ids = quants.filtered( lambda x: x.product_id.qty_available_not_res > 0 ).ids - result = self.env.ref("stock.group_stock_multi_locations").read()[0] + result = self.env.ref("stock.dashboard_open_quants").read()[0] + result["display_name"] = _("Stock On Hand (Unreserved)") result["domain"] = [("id", "in", quant_ids)] result["context"] = { "search_default_locationgroup": 1, diff --git a/stock_available_unreserved/tests/test_stock_available_unreserved.py b/stock_available_unreserved/tests/test_stock_available_unreserved.py index aaf4407d..4642e243 100644 --- a/stock_available_unreserved/tests/test_stock_available_unreserved.py +++ b/stock_available_unreserved/tests/test_stock_available_unreserved.py @@ -87,7 +87,7 @@ def setUpClass(cls): "product_id": cls.productA.id, "product_uom": cls.productA.uom_id.id, "product_uom_qty": 2, - "quantity_done": 2, + "quantity": 2, "location_id": cls.supplier_location.id, "location_dest_id": cls.stock_location.id, }, @@ -110,7 +110,7 @@ def setUpClass(cls): "product_id": cls.productB.id, "product_uom": cls.productB.uom_id.id, "product_uom_qty": 3, - "quantity_done": 3, + "quantity": 3, "location_id": cls.supplier_location.id, "location_dest_id": cls.stock_location.id, }, @@ -123,7 +123,6 @@ def setUpClass(cls): "picking_type_id": cls.env.ref("stock.picking_type_out").id, "location_id": cls.stock_location.id, "location_dest_id": cls.customer_location.id, - "immediate_transfer": False, "move_ids": [ ( 0, @@ -142,7 +141,7 @@ def setUpClass(cls): ) def compare_qty_available_not_res(self, product, value): - product.invalidate_cache() + product.invalidate_recordset() self.assertEqual(product.qty_available_not_res, value) def test_01_stock_levels(self): diff --git a/stock_available_unreserved/views/product_view.xml b/stock_available_unreserved/views/product_view.xml index 9907daa0..5a7789fe 100644 --- a/stock_available_unreserved/views/product_view.xml +++ b/stock_available_unreserved/views/product_view.xml @@ -58,7 +58,7 @@