Olivier Ligot has proposed merging 
lp:~openerp-groupes/openobject-client-web/fix_change_password into 
lp:openobject-client-web.

Requested reviews:
  OpenERP SA's Web Client R&D (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-groupes/openobject-client-web/fix_change_password/+merge/44789

Due to commit 3108.1.3 in openobject-server/trunk, the change of the user
password via the preferences view fails, as the web client passes the
old password to the server.
This branch fixes the problem by updating the cache of the web client after
a change of password.

The same work has still to be done for the GTK client.
-- 
https://code.launchpad.net/~openerp-groupes/openobject-client-web/fix_change_password/+merge/44789
Your team OpenERP SA's Web Client R&D is requested to review the proposed merge 
of lp:~openerp-groupes/openobject-client-web/fix_change_password into 
lp:openobject-client-web.
=== modified file 'addons/openerp/controllers/preferences.py'
--- addons/openerp/controllers/preferences.py	2010-12-22 16:28:46 +0000
+++ addons/openerp/controllers/preferences.py	2010-12-28 15:52:11 +0000
@@ -73,7 +73,10 @@
         params, data = TinyDict.split(kw)
         proxy = rpc.RPCProxy('res.users')
         proxy.write([rpc.session.uid], data)
-        rpc.session.context_reload()
+        if 'password' in data:
+            rpc.session.relogin(data['password'])
+        else:
+            rpc.session.context_reload()
         raise redirect('/openerp/pref/create', saved=True)
 
     @expose()

=== modified file 'addons/openerp/utils/rpc.py'
--- addons/openerp/utils/rpc.py	2010-12-03 16:15:45 +0000
+++ addons/openerp/utils/rpc.py	2010-12-28 15:52:11 +0000
@@ -290,6 +290,16 @@
                 return None
             raise
 
+    def relogin(self, password):
+        """ Re-login after a password change.
+
+        :param password: The new password
+        :type password: str
+        :return: User identifier
+        :rtype: int
+        """
+        return self.login(self.storage['db'], self.storage['loginname'], password)
+
     def login(self, db, user, password):
 
         if not (db and user and password):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-web
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-web
More help   : https://help.launchpad.net/ListHelp

Reply via email to