[MIG] product_quantity_update_force_inventory: Migration to 14.0

This commit is contained in:
mariadforgeflow
2021-12-30 14:52:16 +01:00
parent 741c93159e
commit e811bd35f6
3 changed files with 5 additions and 5 deletions

View File

@@ -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",

View File

@@ -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")],

View File

@@ -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)],
)