mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Add last version of review1961002 which works for me
This commit is contained in:
parent
569988b939
commit
501e587f29
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue