Use standard RPC call to set_preferences
issue7568 review70291002
This commit is contained in:
1 parent
82dd8cc2ec
commit
b3d90ad9ed
1 file changed
+4
-13
@@ -6,10 +6,9 @@ import gtk
|
||||
import copy
|
||||
|
||||
import tryton.rpc as rpc
|
||||
from tryton.common import RPCExecute, RPCException, Login, IconFactory
|
||||
from tryton.common import RPCExecute, RPCException, IconFactory
|
||||
from tryton.common.underline import set_underline
|
||||
from tryton.config import TRYTON_ICON
|
||||
from tryton.exceptions import TrytonError
|
||||
from tryton.gui import Main
|
||||
from tryton.gui.window.nomodal import NoModal
|
||||
from tryton.gui.window.view_form.screen import Screen
|
||||
@@ -95,18 +94,10 @@ class Preference(NoModal):
|
||||
if response_id == gtk.RESPONSE_OK:
|
||||
if self.screen.current_record.validate():
|
||||
vals = copy.copy(self.screen.get())
|
||||
context = rpc.CONTEXT.copy()
|
||||
|
||||
def login(parameters):
|
||||
return rpc.execute(
|
||||
'model', 'res.user', 'set_preferences',
|
||||
vals, parameters, context)
|
||||
try:
|
||||
Login(login)
|
||||
except TrytonError as exception:
|
||||
if exception.faultCode == 'QueryCanceled':
|
||||
return
|
||||
raise
|
||||
RPCExecute('model', 'res.user', 'set_preferences', vals)
|
||||
except RPCException:
|
||||
return
|
||||
self.parent.present()
|
||||
self.destroy()
|
||||
self.callback()
|
||||
|
||||
Reference in new issue
Block a user