Merge lp:~jfb-tempo-consulting/unifield-web/US-3935 into lp:unifield-web/uf7

Proposed by jftempo on 2018-02-13
Status: Needs review
Proposed branch: lp:~jfb-tempo-consulting/unifield-web/US-3935
Merge into: lp:unifield-web/uf7
Diff against target: 118 lines (+27/-12)
6 files modified
addons/openerp/controllers/templates/form.mako (+0/-9)
addons/openerp/static/javascript/openerp/openerp.base.js (+2/-0)
addons/openerp/widgets/form/_form.py (+8/-1)
addons/openerp/widgets/screen.py (+2/-2)
addons/openerp/widgets/templates/listgrid/listgrid.mako (+14/-0)
addons/openerp/widgets/templates/screen.mako (+1/-0)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-web/US-3935
Reviewer Review Type Date Requested Status
UniField Dev Team 2018-02-13 Pending
Review via email: mp+337640@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

4895. By jftempo on 2018-02-09

Icon

4894. By jftempo on 2018-02-08

Form view: humane_size

4893. By jftempo on 2018-02-07

Icon

4892. By jftempo on 2018-02-02

US-4124: Sync monitor auto-refresh: do not refresh all the page but only the list

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/templates/form.mako'
2--- addons/openerp/controllers/templates/form.mako 2017-10-27 12:14:43 +0000
3+++ addons/openerp/controllers/templates/form.mako 2018-02-13 14:39:48 +0000
4@@ -25,15 +25,6 @@
5 /*
6 % endif
7 */
8- /*
9- % if auto_refresh :
10- */
11- setTimeout(function() {
12- location.reload();
13- }, ${auto_refresh}*1000);
14- /*
15- % endif
16- */
17 setTimeout(function() {
18 jQuery('[autofocus="autofocus"]').focus();
19 }, 10);
20
21=== added file 'addons/openerp/static/images/cloud.png'
22Binary files addons/openerp/static/images/cloud.png 1970-01-01 00:00:00 +0000 and addons/openerp/static/images/cloud.png 2018-02-13 14:39:48 +0000 differ
23=== added file 'addons/openerp/static/images/db_dump.png'
24Binary files addons/openerp/static/images/db_dump.png 1970-01-01 00:00:00 +0000 and addons/openerp/static/images/db_dump.png 2018-02-13 14:39:48 +0000 differ
25=== added file 'addons/openerp/static/images/monitor.png'
26Binary files addons/openerp/static/images/monitor.png 1970-01-01 00:00:00 +0000 and addons/openerp/static/images/monitor.png 2018-02-13 14:39:48 +0000 differ
27=== modified file 'addons/openerp/static/javascript/openerp/openerp.base.js'
28--- addons/openerp/static/javascript/openerp/openerp.base.js 2017-11-28 15:35:57 +0000
29+++ addons/openerp/static/javascript/openerp/openerp.base.js 2018-02-13 14:39:48 +0000
30@@ -431,3 +431,5 @@
31
32 }
33 });
34+
35+var global_list_refresh;
36
37=== modified file 'addons/openerp/widgets/form/_form.py'
38--- addons/openerp/widgets/form/_form.py 2017-10-20 09:24:34 +0000
39+++ addons/openerp/widgets/form/_form.py 2018-02-13 14:39:48 +0000
40@@ -30,7 +30,7 @@
41 import cherrypy
42 import simplejson
43 from openerp import validators
44-from openerp.utils import rpc, icons, common, TinyDict, node_attributes, get_node_xpath, expr_eval
45+from openerp.utils import rpc, icons, common, TinyDict, node_attributes, get_node_xpath, expr_eval, get_size
46 from openerp.widgets import TinyWidget, TinyInputWidget, InputWidgetLabel, ConcurrencyInfo, get_widget, register_widget
47
48 from _binary import Image
49@@ -367,6 +367,13 @@
50 register_widget(Char, ["char"])
51
52
53+class HumanSize(Char):
54+
55+ def set_value(self, value):
56+ self.default = get_size(value or 0.0)
57+register_widget(HumanSize, ["human_size"])
58+
59+
60 class Email(TinyInputWidget):
61 template = "/openerp/widgets/form/templates/email.mako"
62
63
64=== modified file 'addons/openerp/widgets/screen.py'
65--- addons/openerp/widgets/screen.py 2017-10-12 09:36:10 +0000
66+++ addons/openerp/widgets/screen.py 2018-02-13 14:39:48 +0000
67@@ -33,7 +33,7 @@
68
69 params = ['model', 'state', 'id', 'ids', 'view_id', 'view_ids', 'view_mode', 'view_type', 'domain',
70 'context', 'limit', 'offset', 'count', 'approximation',
71- 'group_by_ctx', 'action_id', 'target_action_id']
72+ 'group_by_ctx', 'action_id', 'target_action_id', 'auto_refresh']
73
74 member_widgets = ['widget']
75
76@@ -43,7 +43,7 @@
77 params = params or cherrypy.request.terp_params
78 prefix = prefix or (params.prefix or '')
79 super(Screen, self).__init__(prefix=prefix, name=name)
80-
81+ self.auto_refresh = params.auto_refresh or ''
82 self.model = params.model
83 self.state = params.state or None
84 self.id = params.id or False
85
86=== modified file 'addons/openerp/widgets/templates/listgrid/listgrid.mako'
87--- addons/openerp/widgets/templates/listgrid/listgrid.mako 2017-12-01 14:40:07 +0000
88+++ addons/openerp/widgets/templates/listgrid/listgrid.mako 2018-02-13 14:39:48 +0000
89@@ -7,6 +7,20 @@
90 if o2m:
91 object = "new One2Many('%s')" % name
92 %>
93+<script type="text/javascript">
94+var auto_field = $('#_terp_auto_refresh');
95+var model = $('#_terp_model').val();
96+if (auto_field && auto_field.val()){
97+ if (global_list_refresh) {
98+ clearTimeout(global_list_refresh);
99+ }
100+ global_list_refresh = setTimeout(function(model) {
101+ if (model == $('#_terp_model').val()) {
102+ new ListView('_terp_list').reload();
103+ }
104+ }, 1000*auto_field.val(), model);
105+}
106+</script>
107 <%def name="make_editors(data=None)">
108 % if editable and editors:
109 <tr class="grid-row editors" record="${(data and data['id']) or -1}">
110
111=== modified file 'addons/openerp/widgets/templates/screen.mako'
112--- addons/openerp/widgets/templates/screen.mako 2017-04-19 14:36:32 +0000
113+++ addons/openerp/widgets/templates/screen.mako 2018-02-13 14:39:48 +0000
114@@ -1,3 +1,4 @@
115+<input type="hidden" id="${name}_terp_auto_refresh" name="${name}_terp_auto_refresh" value="${auto_refresh}"/>
116 <input type="hidden" id="${name}_terp_string" name="${name}_terp_string" value="${string}"/>
117 <input type="hidden" id="${name}_terp_model" name="${name}_terp_model" value="${model}"/>
118 <input type="hidden" id="${name}_terp_state" name="${name}_terp_state" value="${state}"/>

Subscribers

People subscribed via source and target branches

to all changes: