diff --git a/stock_demand_estimate/__manifest__.py b/stock_demand_estimate/__manifest__.py index eaa4873fb..0f169e045 100644 --- a/stock_demand_estimate/__manifest__.py +++ b/stock_demand_estimate/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Stock Demand Estimate", "summary": "Allows to create demand estimates.", - "version": "15.0.1.0.1", + "version": "16.0.1.0.1", "author": "ForgeFlow, Odoo Community Association (OCA)", "development_status": "Production/Stable", "website": "https://github.com/OCA/stock-logistics-warehouse", diff --git a/stock_demand_estimate/tests/test_stock_demand_estimate.py b/stock_demand_estimate/tests/test_stock_demand_estimate.py index fafe0f034..5ede169e3 100644 --- a/stock_demand_estimate/tests/test_stock_demand_estimate.py +++ b/stock_demand_estimate/tests/test_stock_demand_estimate.py @@ -3,6 +3,7 @@ from datetime import date, timedelta as td +from odoo.exceptions import UserError from odoo.tests.common import TransactionCase @@ -165,3 +166,10 @@ class TestStockDemandEstimate(TransactionCase): estimate.manual_duration = 5 estimate._onchange_manual_duration() self.assertEqual(estimate.manual_date_to, date_from + td(days=4)) + estimate._compute_product_quantity() + self.assertEqual(estimate.product_qty, 500) + with self.assertRaises(UserError): + estimate._inverse_product_quantity() + estimate.product_uom = False + estimate._compute_product_quantity() + self.assertEqual(estimate.product_qty, 0)