Add test to prevent create move at the closed period date

issue7489
review45721002
This commit is contained in:
Cédric Krier committed 2018-09-17 17:48:26 +02:00
1 parent 03ddb0f77b
commit 258f9ad9e5
1 file changed
+13
+13
View File
@@ -819,6 +819,7 @@ class StockTestCase(ModuleTestCase):
({'stock_date_end': today + relativedelta(days=-4)}, 25),
({'stock_date_end': today + relativedelta(days=-3)}, 20),
({'stock_date_end': today + relativedelta(days=-2)}, 20),
({'stock_date_end': today + relativedelta(days=-1)}, 20),
({'stock_date_end': today}, 20),
({'stock_date_end': datetime.date.max}, 23),
]
@@ -877,6 +878,18 @@ class StockTestCase(ModuleTestCase):
'unit_price': Decimal('1'),
'currency': currency.id,
}])
self.assertRaises(Exception, Move.create, [{
'product': product.id,
'uom': unit.id,
'quantity': 10,
'from_location': supplier.id,
'to_location': storage.id,
'planned_date': today + relativedelta(days=-3),
'effective_date': today + relativedelta(days=-3),
'company': company.id,
'unit_price': Decimal('1'),
'currency': currency.id,
}])
# Test close period check
period, = Period.create([{