~openerp-dev/openobject-client/trunk-gtk-glade-revert

« back to all changes in this revision

Viewing changes to bin/modules/gui/main.py

  • Committer: Antony Lesuisse
  • Date: 2011-10-24 21:52:33 UTC
  • Revision ID: al@openerp.com-20111024215233-l5lc9h8c1a01tvv2
[REM] version check

Show diffs side-by-side

added added

removed removed

Lines of Context:
455
455
        self.win = self.win_gl.get_widget('win_login')
456
456
 
457
457
    def refreshlist(self, widget, db_widget, entry_db, label, url, butconnect=False):
458
 
 
459
 
        def check_server_version(url):
460
 
            try:
461
 
                import release
462
 
                full_server_version = rpc.session.db_exec_no_except(url, 'server_version')
463
 
                server_version = full_server_version.split('.')
464
 
                client_version = release.version.split('.')
465
 
                return (server_version[:2] == client_version[:2], full_server_version, release.version)
466
 
            except:
467
 
                # the server doesn't understand the request. It's mean that it's an old version of the server
468
 
                return (False, _('Unknown'), release.version)
469
 
 
470
 
        if _refresh_dblist(db_widget, entry_db, label, butconnect, url):
471
 
            is_same_version, server_version, client_version = check_server_version(url)
472
 
            if not is_same_version:
473
 
                common.warning(_('The versions of the server %(server_version)s and the client %(client_version)s mismatch. The client may not work properly. Use it at your own risks.')
474
 
                               % {'server_version':server_version, 'client_version':client_version},parent=self.win)
 
458
        return _refresh_dblist(db_widget, entry_db, label, butconnect, url)
475
459
 
476
460
    def refreshlist_ask(self,widget, server_widget, db_widget, entry_db, label, butconnect = False, url=False, parent=None):
477
461
        url = _server_ask(server_widget, parent) or url