From 166cd6fa6a7cd42e811362a46c830f999fc1d917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 17 Sep 2014 21:45:07 +0200 Subject: [PATCH] Use context to check model and field access issue4081 review8481002 --- stock.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stock.py b/stock.py index 5f88f79f9a..f3dcae0eba 100644 --- a/stock.py +++ b/stock.py @@ -170,11 +170,10 @@ class Move: cost += move_cost_price * Decimal(str(move_qty)) - with Transaction().set_user(0, set_context=True): - cls.write([move], { - as_qty_field: ( - (getattr(move, as_qty_field) or 0.0) + move_qty), - }) + cls.write([move], { + as_qty_field: ( + (getattr(move, as_qty_field) or 0.0) + move_qty), + }) if consumed_qty < total_qty: qty = total_qty - consumed_qty