From 00026f3fcef8a0799fb83d3c1b3619b7c8f56955 Mon Sep 17 00:00:00 2001 From: oihane Date: Mon, 16 Mar 2015 11:54:41 +0100 Subject: [PATCH] [FIX] Unlinking quants fails with non-admin users, avoided. Closes #719 --- models/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/stock.py b/models/stock.py index 8918f1c86..5f7b7fd8d 100644 --- a/models/stock.py +++ b/models/stock.py @@ -24,7 +24,7 @@ class StockQuant(models.Model): if self._get_latest_move(self) == self._get_latest_move(quant): self.qty += quant.qty self.cost += quant.cost - quant.unlink() + quant.sudo().unlink() @api.model def quants_unreserve(self, move):