Remove auto-refresh
issue3752 review4221003
This commit is contained in:
1 parent
5496f8ff4b
commit
ce5d9ce9ad
6 files changed
+9
-22
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Remove auto-refresh
|
||||
* Add support of domain for non-relation field
|
||||
* Allow drag & drop on the attachment button
|
||||
* Replace sha widget by password
|
||||
|
||||
@@ -131,7 +131,6 @@ class Action(object):
|
||||
Window.create(view_ids, res_model, res_id, domain,
|
||||
action_ctx, order, view_mode, name=name,
|
||||
limit=action.get('limit'),
|
||||
auto_refresh=action.get('auto_refresh'),
|
||||
search_value=search_value,
|
||||
icon=(action.get('icon.rec_name') or ''),
|
||||
tab_domain=tab_domain)
|
||||
|
||||
+1
-2
@@ -1451,7 +1451,6 @@ class Main(object):
|
||||
try:
|
||||
view_ids = json.loads(params.get('views', 'false'))
|
||||
limit = json.loads(params.get('limit', 'null'))
|
||||
auto_refresh = json.loads(params.get('auto_refresh', 'false'))
|
||||
name = json.loads(params.get('window_name', 'false'))
|
||||
search_value = json.loads(params.get('search_value', '{}'),
|
||||
object_hook=object_hook)
|
||||
@@ -1470,7 +1469,7 @@ class Main(object):
|
||||
try:
|
||||
Window.create(view_ids, model, res_id=res_id, domain=domain,
|
||||
context=context, mode=mode, name=name, limit=limit,
|
||||
auto_refresh=auto_refresh, search_value=search_value)
|
||||
search_value=search_value)
|
||||
except Exception:
|
||||
# Prevent crashing the client
|
||||
return
|
||||
|
||||
@@ -37,8 +37,7 @@ class Board(SignalEvent, TabContent):
|
||||
'<tryton>/Form/Close'),
|
||||
]
|
||||
|
||||
def __init__(self, model, view_id, context=None, name=False,
|
||||
auto_refresh=False):
|
||||
def __init__(self, model, view_id, context=None, name=False):
|
||||
super(Board, self).__init__()
|
||||
|
||||
try:
|
||||
@@ -51,7 +50,6 @@ class Board(SignalEvent, TabContent):
|
||||
self.model = model
|
||||
self.view_id = view_id
|
||||
self.context = context
|
||||
self.auto_refresh = auto_refresh
|
||||
self.dialogs = []
|
||||
if not name:
|
||||
self.name = self.board.name
|
||||
@@ -81,8 +79,7 @@ class Board(SignalEvent, TabContent):
|
||||
return (self.model == value.model
|
||||
and self.view_id == value.view_id
|
||||
and self.context == value.context
|
||||
and self.name == value.name
|
||||
and self.auto_refresh == value.auto_refresh)
|
||||
and self.name == value.name)
|
||||
|
||||
def sig_win_close(self, widget):
|
||||
Main.get_main().sig_win_close(widget)
|
||||
|
||||
@@ -87,7 +87,7 @@ class Form(SignalEvent, TabContent):
|
||||
|
||||
def __init__(self, model, res_id=False, domain=None, order=None, mode=None,
|
||||
view_ids=None, context=None, name=False, limit=None,
|
||||
auto_refresh=False, search_value=None, tab_domain=None):
|
||||
search_value=None, tab_domain=None):
|
||||
super(Form, self).__init__()
|
||||
|
||||
if not mode:
|
||||
@@ -104,14 +104,12 @@ class Form(SignalEvent, TabContent):
|
||||
self.domain = domain
|
||||
self.mode = mode
|
||||
self.context = context
|
||||
self.auto_refresh = auto_refresh
|
||||
self.view_ids = view_ids
|
||||
self.dialogs = []
|
||||
|
||||
self.screen = Screen(self.model, mode=mode, context=self.context,
|
||||
view_ids=view_ids, domain=domain, limit=limit, order=order,
|
||||
readonly=bool(auto_refresh), search_value=search_value,
|
||||
tab_domain=tab_domain)
|
||||
search_value=search_value, tab_domain=tab_domain)
|
||||
self.screen.widget.show()
|
||||
|
||||
if not name:
|
||||
@@ -156,9 +154,6 @@ class Form(SignalEvent, TabContent):
|
||||
in ('tree', 'graph', 'calendar'):
|
||||
self.screen.search_filter()
|
||||
|
||||
if auto_refresh and int(auto_refresh):
|
||||
gobject.timeout_add(int(auto_refresh) * 1000, self.sig_reload)
|
||||
|
||||
def get_toolbars(self):
|
||||
try:
|
||||
return RPCExecute('model', self.model, 'view_toolbar_get',
|
||||
@@ -182,7 +177,6 @@ class Form(SignalEvent, TabContent):
|
||||
and self.context == value.context
|
||||
and self.name == value.name
|
||||
and self.screen.limit == value.screen.limit
|
||||
and self.auto_refresh == value.auto_refresh
|
||||
and self.screen.search_value == value.screen.search_value)
|
||||
|
||||
def destroy(self):
|
||||
@@ -337,8 +331,6 @@ class Form(SignalEvent, TabContent):
|
||||
self.activate_save()
|
||||
|
||||
def sig_reload(self, test_modified=True):
|
||||
if not hasattr(self, 'screen'):
|
||||
return False
|
||||
if test_modified and not self.modified_save():
|
||||
return False
|
||||
self.screen.cancel_current()
|
||||
|
||||
@@ -21,7 +21,7 @@ class Window(object):
|
||||
@staticmethod
|
||||
def create(view_ids, model, res_id=False, domain=None,
|
||||
context=None, order=None, mode=None, name=False, limit=None,
|
||||
auto_refresh=False, search_value=None, icon=None, tab_domain=None):
|
||||
search_value=None, icon=None, tab_domain=None):
|
||||
from tryton.gui import Main
|
||||
if context is None:
|
||||
context = {}
|
||||
@@ -30,12 +30,11 @@ class Window(object):
|
||||
from form import Form
|
||||
win = Form(model, res_id, domain, order=order, mode=mode,
|
||||
view_ids=(view_ids or []), context=context, name=name,
|
||||
limit=limit, auto_refresh=auto_refresh,
|
||||
search_value=search_value, tab_domain=tab_domain)
|
||||
limit=limit, search_value=search_value, tab_domain=tab_domain)
|
||||
else:
|
||||
from board import Board
|
||||
win = Board(model, view_ids and view_ids[0] or None,
|
||||
context=context, name=name, auto_refresh=auto_refresh)
|
||||
context=context, name=name)
|
||||
win.icon = icon
|
||||
Main.get_main().win_add(win, hide_current=Window.hide_current,
|
||||
allow_similar=Window.allow_similar)
|
||||
|
||||
Reference in new issue
Block a user