Add last version of review1961002 which works for me

This commit is contained in:
Sergi Almacellas Abellana 2013-12-12 13:30:19 +01:00
parent 569988b939
commit 501e587f29
2 changed files with 13 additions and 6 deletions

View file

@ -1,5 +1,6 @@
Index: trytond/trytond/tests/test_transaction.py
===================================================================
--- a/trytond/trytond/tests/test_transaction.py
+++ b/trytond/trytond/tests/test_transaction.py
@@ -56,6 +56,41 @@
@ -44,18 +45,22 @@ Index: trytond/trytond/tests/test_transaction.py
def suite():
return unittest.TestLoader().loadTestsFromTestCase(TransactionTestCase)
Index: trytond/trytond/transaction.py
===================================================================
--- a/trytond/trytond/transaction.py
+++ b/trytond/trytond/transaction.py
@@ -118,10 +118,15 @@
@@ -118,10 +118,16 @@
return manager
def set_user(self, user, set_context=False):
+ if user != 0 and set_context:
+ raise ValueError('set_context only allowed for root')
manager = _AttributeManager(user=self.user,
context=self.context.copy())
- context=self.context.copy())
+ context=self.context)
+ self.context = self.context.copy()
if set_context:
- self.context.update({'user': self.user})
+ if user != self.user:
@ -65,3 +70,4 @@ Index: trytond/trytond/transaction.py
self.user = user
return manager

1
series
View file

@ -1,2 +1,3 @@
issue1961002_40001.diff
issue10739.diff
issue10467.diff