From 2060c8f391ad53ca25774f8626ed3f74ebc960a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 9 Apr 2009 11:43:00 +0200 Subject: [PATCH] Validate with the context user if user is root --- trytond/model/modelstorage.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/trytond/model/modelstorage.py b/trytond/model/modelstorage.py index a25198f9ab..6d9ad0ecf6 100644 --- a/trytond/model/modelstorage.py +++ b/trytond/model/modelstorage.py @@ -789,6 +789,12 @@ class ModelStorage(Model): def _validate(self, cursor, user, ids, context=None): if context is None: context = {} + + if user == 0 and context.get('user'): + ctx = context.copy() + del ctx['user'] + return self._validate(cursor, context['user'], ids, context=ctx) + context = context.copy() field_error = [] field_err_str = []