diff --git a/mrp_progress_button/__manifest__.py b/mrp_progress_button/__manifest__.py
index 20c438837..16a8cc4eb 100644
--- a/mrp_progress_button/__manifest__.py
+++ b/mrp_progress_button/__manifest__.py
@@ -8,7 +8,7 @@
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/manufacture",
"category": "Manufacturing",
- "version": "12.0.1.0.0",
+ "version": "14.0.1.0.0",
"license": "AGPL-3",
"depends": ["mrp"],
"data": ["views/production.xml"],
diff --git a/mrp_progress_button/models/mrp_production.py b/mrp_progress_button/models/mrp_production.py
index 467824288..70935681f 100644
--- a/mrp_progress_button/models/mrp_production.py
+++ b/mrp_progress_button/models/mrp_production.py
@@ -4,13 +4,12 @@
from datetime import datetime
-from odoo import api, models
+from odoo import models
class MrpProduction(models.Model):
_inherit = "mrp.production"
- @api.multi
def action_progress(self):
self.write(
{
diff --git a/mrp_progress_button/tests/test_progress_button.py b/mrp_progress_button/tests/test_progress_button.py
index 03a9bc0c3..02570c000 100644
--- a/mrp_progress_button/tests/test_progress_button.py
+++ b/mrp_progress_button/tests/test_progress_button.py
@@ -56,15 +56,29 @@ class TestProgressButton(TransactionCase):
def _update_product_qty(self, product, location, quantity):
"""Update Product quantity."""
- product_qty = self.env["stock.change.product.qty"].create(
+ inventory = self.env["stock.inventory"].create(
{
- "location_id": location.id,
- "product_id": product.id,
- "new_quantity": quantity,
+ "name": "Test Inventory",
+ "product_ids": [(6, 0, product.ids)],
+ "state": "confirm",
+ "line_ids": [
+ (
+ 0,
+ 0,
+ {
+ "product_qty": quantity,
+ "location_id": location.id,
+ "product_id": product.id,
+ "product_uom_id": product.uom_id.id,
+ },
+ )
+ ],
}
)
- product_qty.change_product_qty()
- return product_qty
+ inventory.action_start()
+ inventory.line_ids[0].write({"product_qty": quantity})
+ inventory.action_validate()
+ return quantity
def test_manufacture_with_forecast_stock(self):
"""
diff --git a/mrp_progress_button/views/production.xml b/mrp_progress_button/views/production.xml
index fd23420dd..1c7399c69 100644
--- a/mrp_progress_button/views/production.xml
+++ b/mrp_progress_button/views/production.xml
@@ -5,10 +5,10 @@
mrp.production
-