[FIX] stock_account: correctly force cost_method in tests

Oversight of previous forward-port.
This commit is contained in:
Christophe Simonis
2019-05-31 16:13:49 +02:00
parent 6c16a1f3ba
commit b1970c6f08
@@ -997,7 +997,7 @@ class TestStockValuation(TransactionCase):
self.assertEqual(move9.remaining_qty, 0.0) # unused in out moves
def test_fifo_perpetual_3(self):
self.product1.cost_method = 'fifo'
self.product1.categ_id.property_cost_method = 'fifo'
# in 10 @ 100
move1 = self.env['stock.move'].create({
@@ -1110,7 +1110,7 @@ class TestStockValuation(TransactionCase):
def test_fifo_perpetual_4(self):
""" Fifo and return handling.
"""
self.product1.cost_method = 'fifo'
self.product1.categ_id.property_cost_method = 'fifo'
# in 8 @ 10
move1 = self.env['stock.move'].create({
@@ -2588,7 +2588,7 @@ class TestStockValuation(TransactionCase):
self.assertAlmostEqual(self.product1.stock_value, 0.0)
def test_average_perpetual_6(self):
self.product1.product_tmpl_id.cost_method = 'average'
self.product1.categ_id.property_cost_method = 'average'
move1 = self.env['stock.move'].create({
'name': 'Receive 1 unit at 10',
@@ -2625,7 +2625,7 @@ class TestStockValuation(TransactionCase):
""" Test edit in the past. Receive 5@10, receive 10@20, edit the first move to receive
15 instead.
"""
self.product1.product_tmpl_id.cost_method = 'average'
self.product1.categ_id.property_cost_method = 'average'
move1 = self.env['stock.move'].create({
'name': 'IN 5@10',
@@ -2665,7 +2665,7 @@ class TestStockValuation(TransactionCase):
""" Receive 1@10, then dropship 1@20, finally return the dropship. Dropship should not
impact the price.
"""
self.product1.product_tmpl_id.cost_method = 'average'
self.product1.categ_id.property_cost_method = 'average'
move1 = self.env['stock.move'].create({
'name': 'IN 1@10',