[FIX] it should be possible to delete quants after the revaluation has been posted.

This commit is contained in:
Jordi Ballester
2017-03-29 11:38:27 +02:00
committed by Jordi Ballester Alomar
parent b72c1a703a
commit b7b36ca09b
2 changed files with 7 additions and 1 deletions

View File

@@ -425,7 +425,7 @@ class StockInventoryRevaluationQuant(models.Model):
readonly=True)
quant_id = fields.Many2one('stock.quant', 'Quant', required=True,
readonly=True,
readonly=True, ondelete='cascade',
domain=[('product_id.type', '=', 'product')])
product_id = fields.Many2one('product.product', 'Product',

View File

@@ -234,6 +234,12 @@ class TestStockInventoryRevaluation(TransactionCase):
'Incorrect inventory revaluation for '
'type Price Change.')
quants = self.env['stock.quant'].search([('product_id', '=',
self.product_real_1.id)])
# We should be able to delete the quants afterwards
quants.with_context(force_unlink=True).unlink()
def create_inventory_revaluation_price_change_average(self):
revaluation_type = 'price_change'
# Create an Inventory Revaluation for average cost product