diff --git a/product_quantity_update_force_inventory/__manifest__.py b/product_quantity_update_force_inventory/__manifest__.py index 0de7a5402..e6229f036 100644 --- a/product_quantity_update_force_inventory/__manifest__.py +++ b/product_quantity_update_force_inventory/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Product Quantity Update Force Inventory", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "author": "ForgeFlow, Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-warehouse", "category": "Warehouse", diff --git a/product_quantity_update_force_inventory/models/product.py b/product_quantity_update_force_inventory/models/product.py index 7e56bdc7a..69d69cd2c 100644 --- a/product_quantity_update_force_inventory/models/product.py +++ b/product_quantity_update_force_inventory/models/product.py @@ -10,7 +10,7 @@ class ProductTemplate(models.Model): """Create an Inventory Adjustment instead of edit directly on quants""" self.ensure_one() view_form_id = self.env.ref("stock.view_inventory_form").id - action = self.env.ref("stock.action_inventory_form").read()[0] + action = self.env.ref("stock.action_inventory_form").sudo().read()[0] action.update( { "views": [(view_form_id, "form")], @@ -31,7 +31,7 @@ class ProductProduct(models.Model): """Create an Inventory Adjustment instead of edit directly on quants""" self.ensure_one() view_form_id = self.env.ref("stock.view_inventory_form").id - action = self.env.ref("stock.action_inventory_form").read()[0] + action = self.env.ref("stock.action_inventory_form").sudo().read()[0] action.update( { "views": [(view_form_id, "form")], diff --git a/product_quantity_update_force_inventory/tests/test_stock_quant_editable_view_block.py b/product_quantity_update_force_inventory/tests/test_stock_quant_editable_view_block.py index fa4bba2e3..8d9bbddc4 100644 --- a/product_quantity_update_force_inventory/tests/test_stock_quant_editable_view_block.py +++ b/product_quantity_update_force_inventory/tests/test_stock_quant_editable_view_block.py @@ -55,7 +55,7 @@ class TestStockQuantEditableViewBlock(TransactionCase): self.assertIn( self.product_product.display_name, action_pp["context"]["default_name"] ) - self.assertEquals( + self.assertEqual( action_pp["context"]["default_product_ids"], [(6, 0, self.product_product.ids)], ) @@ -65,7 +65,7 @@ class TestStockQuantEditableViewBlock(TransactionCase): self.assertIn( self.product_template.display_name, action_pt["context"]["default_name"] ) - self.assertEquals( + self.assertEqual( action_pt["context"]["default_product_ids"], [(6, 0, self.product_template.product_variant_ids.ids)], )