Merge lp:~jfb-tempo-consulting/unifield-web/US-4350 into lp:unifield-web
- US-4350
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4939 |
Proposed branch: | lp:~jfb-tempo-consulting/unifield-web/US-4350 |
Merge into: | lp:unifield-web |
Diff against target: |
262 lines (+56/-11) 15 files modified
addons/openerp/controllers/attachment.py (+2/-3) addons/openerp/controllers/form.py (+0/-2) addons/openerp/controllers/search.py (+4/-0) addons/openerp/po/messages/fr.po (+4/-0) addons/openerp/static/javascript/listgrid.js (+12/-1) addons/openerp/static/javascript/openerp/openerp.base.js (+1/-0) addons/openerp/static/javascript/search.js (+20/-3) addons/openerp/utils/rpc.py (+1/-0) addons/openerp/widgets/_views.py (+1/-0) addons/openerp/widgets/listgrid.py (+5/-1) addons/openerp/widgets/screen.py (+1/-1) addons/openerp/widgets/templates/sidebar.mako (+2/-0) addons/openerp/widgets/templates/viewform.mako (+1/-0) doc/openerp-web-win.cfg (+1/-0) doc/openerp-web.cfg (+1/-0) |
To merge this branch: | bzr merge lp:~jfb-tempo-consulting/unifield-web/US-4350 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Dev Team | Pending | ||
Review via email: mp+357937@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'addons/openerp/controllers/attachment.py' | |||
2 | --- addons/openerp/controllers/attachment.py 2017-02-06 11:21:15 +0000 | |||
3 | +++ addons/openerp/controllers/attachment.py 2018-10-29 09:32:00 +0000 | |||
4 | @@ -71,10 +71,9 @@ | |||
5 | 71 | raise Exception('Unknown attachment type %(type)s for attachment name %(name)s' % attachment) | 71 | raise Exception('Unknown attachment type %(type)s for attachment name %(name)s' % attachment) |
6 | 72 | 72 | ||
7 | 73 | @expose('json', methods=('POST',)) | 73 | @expose('json', methods=('POST',)) |
10 | 74 | def save(self, datas, **kwargs): | 74 | def save(self, model, model_id, datas, **kwargs): |
9 | 75 | params, data = TinyDict.split(cherrypy.session['params']) | ||
11 | 76 | ctx = dict(rpc.session.context, | 75 | ctx = dict(rpc.session.context, |
13 | 77 | default_res_model=params.model, default_res_id=params.id, | 76 | default_res_model=model, default_res_id=model_id, |
14 | 78 | active_id=False, active_ids=[]) | 77 | active_id=False, active_ids=[]) |
15 | 79 | ctx['from_web_interface'] = True | 78 | ctx['from_web_interface'] = True |
16 | 80 | 79 | ||
17 | 81 | 80 | ||
18 | === modified file 'addons/openerp/controllers/form.py' | |||
19 | --- addons/openerp/controllers/form.py 2018-03-16 11:04:11 +0000 | |||
20 | +++ addons/openerp/controllers/form.py 2018-10-29 09:32:00 +0000 | |||
21 | @@ -181,8 +181,6 @@ | |||
22 | 181 | if tg_errors: | 181 | if tg_errors: |
23 | 182 | return cherrypy.request.terp_form | 182 | return cherrypy.request.terp_form |
24 | 183 | 183 | ||
25 | 184 | cherrypy.session['params'] = params | ||
26 | 185 | |||
27 | 186 | params.offset = params.offset or 0 | 184 | params.offset = params.offset or 0 |
28 | 187 | params.count = params.count or 0 | 185 | params.count = params.count or 0 |
29 | 188 | params.approximation = params.approximation or False | 186 | params.approximation = params.approximation or False |
30 | 189 | 187 | ||
31 | === modified file 'addons/openerp/controllers/search.py' | |||
32 | --- addons/openerp/controllers/search.py 2018-02-09 14:29:44 +0000 | |||
33 | +++ addons/openerp/controllers/search.py 2018-10-29 09:32:00 +0000 | |||
34 | @@ -502,3 +502,7 @@ | |||
35 | 502 | del context_own[ctx[0]] | 502 | del context_own[ctx[0]] |
36 | 503 | 503 | ||
37 | 504 | return context_own | 504 | return context_own |
38 | 505 | |||
39 | 506 | @expose() | ||
40 | 507 | def kill_search_filter(self, model, unique_id): | ||
41 | 508 | rpc.session.execute('object', 'execute', model, 'kill_search_filter', unique_id, rpc.session.context) | ||
42 | 505 | 509 | ||
43 | === modified file 'addons/openerp/po/messages/fr.po' | |||
44 | --- addons/openerp/po/messages/fr.po 2018-09-20 12:56:09 +0000 | |||
45 | +++ addons/openerp/po/messages/fr.po 2018-10-29 09:32:00 +0000 | |||
46 | @@ -1608,6 +1608,10 @@ | |||
47 | 1608 | msgid "Clear all." | 1608 | msgid "Clear all." |
48 | 1609 | msgstr "Tout effacer." | 1609 | msgstr "Tout effacer." |
49 | 1610 | 1610 | ||
50 | 1611 | #: widgets/templates/viewform.mako:33 | ||
51 | 1612 | msgid "Cancel query" | ||
52 | 1613 | msgstr "Annuler la recherche" | ||
53 | 1614 | |||
54 | 1611 | #: widgets/templates/viewform.mako:35 | 1615 | #: widgets/templates/viewform.mako:35 |
55 | 1612 | msgid "Clear" | 1616 | msgid "Clear" |
56 | 1613 | msgstr "Effacer" | 1617 | msgstr "Effacer" |
57 | 1614 | 1618 | ||
58 | === modified file 'addons/openerp/static/javascript/listgrid.js' | |||
59 | --- addons/openerp/static/javascript/listgrid.js 2018-07-26 15:07:43 +0000 | |||
60 | +++ addons/openerp/static/javascript/listgrid.js 2018-10-29 09:32:00 +0000 | |||
61 | @@ -692,6 +692,7 @@ | |||
62 | 692 | } | 692 | } |
63 | 693 | }); | 693 | }); |
64 | 694 | 694 | ||
65 | 695 | var current_search; | ||
66 | 695 | // standard actions | 696 | // standard actions |
67 | 696 | MochiKit.Base.update(ListView.prototype, { | 697 | MochiKit.Base.update(ListView.prototype, { |
68 | 697 | 698 | ||
69 | @@ -925,6 +926,10 @@ | |||
70 | 925 | 926 | ||
71 | 926 | var prefix = this.name == '_terp_list' ? '' : this.name + '/'; | 927 | var prefix = this.name == '_terp_list' ? '' : this.name + '/'; |
72 | 927 | args[prefix+'_terp_force_limit'] = 1; | 928 | args[prefix+'_terp_force_limit'] = 1; |
73 | 929 | |||
74 | 930 | if (this.name == '_terp_list') { | ||
75 | 931 | jQuery('#kill_search').show(); | ||
76 | 932 | } | ||
77 | 928 | if (this.name == '_terp_list') { | 933 | if (this.name == '_terp_list') { |
78 | 929 | jQuery.extend(args, { | 934 | jQuery.extend(args, { |
79 | 930 | _terp_search_domain: openobject.dom.get('_terp_search_domain').value, | 935 | _terp_search_domain: openobject.dom.get('_terp_search_domain').value, |
80 | @@ -949,18 +954,24 @@ | |||
81 | 949 | args['_terp_clear'] = true; | 954 | args['_terp_clear'] = true; |
82 | 950 | } | 955 | } |
83 | 951 | 956 | ||
84 | 957 | if (unique_id) { | ||
85 | 958 | args['_terp_unique_id'] = unique_id; | ||
86 | 959 | } | ||
87 | 952 | if (ids_to_show) { | 960 | if (ids_to_show) { |
88 | 953 | args['_terp_ids_to_show'] = '['+ids_to_show.join(',')+']'; | 961 | args['_terp_ids_to_show'] = '['+ids_to_show.join(',')+']'; |
89 | 954 | args['_terp_offset'] = 0; | 962 | args['_terp_offset'] = 0; |
90 | 955 | } | 963 | } |
91 | 956 | jQuery(idSelector(self.name) + ' .loading-list').show(); | 964 | jQuery(idSelector(self.name) + ' .loading-list').show(); |
93 | 957 | jQuery.ajax({ | 965 | current_search = jQuery.ajax({ |
94 | 958 | url: '/openerp/listgrid/get', | 966 | url: '/openerp/listgrid/get', |
95 | 959 | data: args, | 967 | data: args, |
96 | 960 | dataType: 'jsonp', | 968 | dataType: 'jsonp', |
97 | 961 | type: 'POST', | 969 | type: 'POST', |
98 | 962 | error: loadingError(), | 970 | error: loadingError(), |
99 | 963 | success: function(obj) { | 971 | success: function(obj) { |
100 | 972 | if (self.name == '_terp_list') { | ||
101 | 973 | jQuery('#kill_search').hide(); | ||
102 | 974 | } | ||
103 | 964 | var _terp_id = openobject.dom.get(self.name + '/_terp_id') || openobject.dom.get('_terp_id'); | 975 | var _terp_id = openobject.dom.get(self.name + '/_terp_id') || openobject.dom.get('_terp_id'); |
104 | 965 | var _terp_ids = openobject.dom.get(self.name + '/_terp_ids') || openobject.dom.get('_terp_ids'); | 976 | var _terp_ids = openobject.dom.get(self.name + '/_terp_ids') || openobject.dom.get('_terp_ids'); |
105 | 966 | var _terp_count = openobject.dom.get(self.name + '/_terp_count') || openobject.dom.get('_terp_count'); | 977 | var _terp_count = openobject.dom.get(self.name + '/_terp_count') || openobject.dom.get('_terp_count'); |
106 | 967 | 978 | ||
107 | === modified file 'addons/openerp/static/javascript/openerp/openerp.base.js' | |||
108 | --- addons/openerp/static/javascript/openerp/openerp.base.js 2018-07-27 09:07:36 +0000 | |||
109 | +++ addons/openerp/static/javascript/openerp/openerp.base.js 2018-10-29 09:32:00 +0000 | |||
110 | @@ -432,3 +432,4 @@ | |||
111 | 432 | }); | 432 | }); |
112 | 433 | 433 | ||
113 | 434 | var global_list_refresh; | 434 | var global_list_refresh; |
114 | 435 | var unique_id =''; | ||
115 | 435 | 436 | ||
116 | === modified file 'addons/openerp/static/javascript/search.js' | |||
117 | --- addons/openerp/static/javascript/search.js 2017-01-02 14:59:00 +0000 | |||
118 | +++ addons/openerp/static/javascript/search.js 2018-10-29 09:32:00 +0000 | |||
119 | @@ -633,12 +633,29 @@ | |||
120 | 633 | if (group_by == 'False') { | 633 | if (group_by == 'False') { |
121 | 634 | group_by = []; | 634 | group_by = []; |
122 | 635 | } | 635 | } |
124 | 636 | 636 | unique_id = new Date().getTime(); | |
125 | 637 | if(jQuery('#filter_table').is(':visible') || jQuery('#_terp_filter_domain').val() != '[]') { | 637 | if(jQuery('#filter_table').is(':visible') || jQuery('#_terp_filter_domain').val() != '[]') { |
127 | 638 | display_Customfilters(all_domains, group_by); | 638 | return display_Customfilters(all_domains, group_by); |
128 | 639 | } else { | 639 | } else { |
129 | 640 | var custom_domain = jQuery('#_terp_filter_domain').val() || '[]'; | 640 | var custom_domain = jQuery('#_terp_filter_domain').val() || '[]'; |
131 | 641 | final_search_domain(custom_domain, all_domains, group_by); | 641 | return final_search_domain(custom_domain, all_domains, group_by); |
132 | 642 | } | ||
133 | 643 | } | ||
134 | 644 | |||
135 | 645 | function kill_search_filter() { | ||
136 | 646 | current_search.abort(); | ||
137 | 647 | jQuery(idSelector('_terp_list') + ' .loading-list').hide(); | ||
138 | 648 | jQuery('#kill_search').hide(); | ||
139 | 649 | $.event.trigger("ajaxStop"); | ||
140 | 650 | if (unique_id) { | ||
141 | 651 | jQuery.ajax({ | ||
142 | 652 | url:'/openerp/search/kill_search_filter', | ||
143 | 653 | data: { | ||
144 | 654 | model: jQuery('#_terp_model').val(), | ||
145 | 655 | unique_id: unique_id, | ||
146 | 656 | }, | ||
147 | 657 | type: 'POST', | ||
148 | 658 | }); | ||
149 | 642 | } | 659 | } |
150 | 643 | } | 660 | } |
151 | 644 | 661 | ||
152 | 645 | 662 | ||
153 | === modified file 'addons/openerp/utils/rpc.py' | |||
154 | --- addons/openerp/utils/rpc.py 2018-02-14 10:46:12 +0000 | |||
155 | +++ addons/openerp/utils/rpc.py 2018-10-29 09:32:00 +0000 | |||
156 | @@ -396,6 +396,7 @@ | |||
157 | 396 | def logout(self): | 396 | def logout(self): |
158 | 397 | try: | 397 | try: |
159 | 398 | self.storage.clear() | 398 | self.storage.clear() |
160 | 399 | cherrypy.session.delete() | ||
161 | 399 | except Exception: | 400 | except Exception: |
162 | 400 | pass | 401 | pass |
163 | 401 | 402 | ||
164 | 402 | 403 | ||
165 | === modified file 'addons/openerp/widgets/_views.py' | |||
166 | --- addons/openerp/widgets/_views.py 2017-10-12 15:54:04 +0000 | |||
167 | +++ addons/openerp/widgets/_views.py 2018-10-29 09:32:00 +0000 | |||
168 | @@ -119,6 +119,7 @@ | |||
169 | 119 | default_data=screen.default_value, | 119 | default_data=screen.default_value, |
170 | 120 | force_readonly=screen.force_readonly, | 120 | force_readonly=screen.force_readonly, |
171 | 121 | approximation=screen.approximation, | 121 | approximation=screen.approximation, |
172 | 122 | unique_id=screen.unique_id, | ||
173 | 122 | filter_selector=screen.filter_selector) | 123 | filter_selector=screen.filter_selector) |
174 | 123 | 124 | ||
175 | 124 | screen.ids = widget.ids | 125 | screen.ids = widget.ids |
176 | 125 | 126 | ||
177 | === modified file 'addons/openerp/widgets/listgrid.py' | |||
178 | --- addons/openerp/widgets/listgrid.py 2018-05-29 16:01:39 +0000 | |||
179 | +++ addons/openerp/widgets/listgrid.py 2018-10-29 09:32:00 +0000 | |||
180 | @@ -184,7 +184,11 @@ | |||
181 | 184 | search_text = terp_params.get('_terp_search_text', False) | 184 | search_text = terp_params.get('_terp_search_text', False) |
182 | 185 | if not self.source: | 185 | if not self.source: |
183 | 186 | self.source = terp_params.get('_terp_source', None) | 186 | self.source = terp_params.get('_terp_source', None) |
184 | 187 | |||
185 | 188 | |||
186 | 187 | if not default_data and not self.o2m and not self.m2m: | 189 | if not default_data and not self.o2m and not self.m2m: |
187 | 190 | if 'unique_id' in kw: | ||
188 | 191 | context['unique_id'] = kw['unique_id'] | ||
189 | 188 | if self.limit > 0: | 192 | if self.limit > 0: |
190 | 189 | if self.sort_key: | 193 | if self.sort_key: |
191 | 190 | ids = proxy.search(search_param, self.offset, self.limit, self.sort_key + ' ' +self.sort_order + ',id', context) | 194 | ids = proxy.search(search_param, self.offset, self.limit, self.sort_key + ' ' +self.sort_order + ',id', context) |
192 | @@ -222,7 +226,7 @@ | |||
193 | 222 | ctx.update(context) | 226 | ctx.update(context) |
194 | 223 | 227 | ||
195 | 224 | try: | 228 | try: |
197 | 225 | data = proxy.read(ids, fields.keys() + ['__last_update'], ctx) | 229 | data = proxy.read_web(ids, fields.keys() + ['__last_update'], ctx) |
198 | 226 | except: | 230 | except: |
199 | 227 | pass | 231 | pass |
200 | 228 | 232 | ||
201 | 229 | 233 | ||
202 | === modified file 'addons/openerp/widgets/screen.py' | |||
203 | --- addons/openerp/widgets/screen.py 2018-04-04 15:01:51 +0000 | |||
204 | +++ addons/openerp/widgets/screen.py 2018-10-29 09:32:00 +0000 | |||
205 | @@ -85,7 +85,7 @@ | |||
206 | 85 | self.count = params.count | 85 | self.count = params.count |
207 | 86 | self.approximation = params.approximation | 86 | self.approximation = params.approximation |
208 | 87 | self.target_action_id = params.target_action_id or False | 87 | self.target_action_id = params.target_action_id or False |
210 | 88 | 88 | self.unique_id = params.unique_id or False | |
211 | 89 | if (self.ids or self.id) and self.count == 0: | 89 | if (self.ids or self.id) and self.count == 0: |
212 | 90 | if self.ids and len(self.ids) < self.limit: | 90 | if self.ids and len(self.ids) < self.limit: |
213 | 91 | self.count = len(self.ids) | 91 | self.count = len(self.ids) |
214 | 92 | 92 | ||
215 | === modified file 'addons/openerp/widgets/templates/sidebar.mako' | |||
216 | --- addons/openerp/widgets/templates/sidebar.mako 2017-07-27 12:07:44 +0000 | |||
217 | +++ addons/openerp/widgets/templates/sidebar.mako 2018-10-29 09:32:00 +0000 | |||
218 | @@ -72,6 +72,8 @@ | |||
219 | 72 | <form id="attachment-box" action="/openerp/attachment/save" method="post" | 72 | <form id="attachment-box" action="/openerp/attachment/save" method="post" |
220 | 73 | enctype="multipart/form-data"> | 73 | enctype="multipart/form-data"> |
221 | 74 | <label for="sidebar_attachments_datas">${_("File")}:</label> | 74 | <label for="sidebar_attachments_datas">${_("File")}:</label> |
222 | 75 | <input type="hidden" name="model" value="${model}" /> | ||
223 | 76 | <input type="hidden" name="model_id" value="${id}" /> | ||
224 | 75 | <input type="file" id="sidebar_attachments_datas" class="binary" | 77 | <input type="file" id="sidebar_attachments_datas" class="binary" |
225 | 76 | name="datas" kind="binary" size="5" | 78 | name="datas" kind="binary" size="5" |
226 | 77 | max-size="${max_attachment_size}"/> | 79 | max-size="${max_attachment_size}"/> |
227 | 78 | 80 | ||
228 | === modified file 'addons/openerp/widgets/templates/viewform.mako' | |||
229 | --- addons/openerp/widgets/templates/viewform.mako 2017-06-01 13:48:36 +0000 | |||
230 | +++ addons/openerp/widgets/templates/viewform.mako 2018-10-29 09:32:00 +0000 | |||
231 | @@ -31,6 +31,7 @@ | |||
232 | 31 | else: | 31 | else: |
233 | 32 | clear_filters = "reload_graph(true);" | 32 | clear_filters = "reload_graph(true);" |
234 | 33 | %> | 33 | %> |
235 | 34 | <button title="${_('Cancel query')}" onclick="kill_search_filter(''); return false;" class="oe_form_button_search" style="display: none;" id="kill_search">${_('Cancel query')}</button> | ||
236 | 34 | <button title="${_('Clear all.')}" id="clear_all_filters" | 35 | <button title="${_('Clear all.')}" id="clear_all_filters" |
237 | 35 | class="oe_form_button_clear" | 36 | class="oe_form_button_clear" |
238 | 36 | onclick="${clear_filters} return false;" | 37 | onclick="${clear_filters} return false;" |
239 | 37 | 38 | ||
240 | === modified file 'doc/openerp-web-win.cfg' | |||
241 | --- doc/openerp-web-win.cfg 2018-04-25 11:58:27 +0000 | |||
242 | +++ doc/openerp-web-win.cfg 2018-10-29 09:32:00 +0000 | |||
243 | @@ -13,6 +13,7 @@ | |||
244 | 13 | 13 | ||
245 | 14 | tools.sessions.on = True | 14 | tools.sessions.on = True |
246 | 15 | tools.sessions.persistent = False | 15 | tools.sessions.persistent = False |
247 | 16 | tools.sessions.locking = 'explicit' | ||
248 | 16 | 17 | ||
249 | 17 | # Simple code profiling | 18 | # Simple code profiling |
250 | 18 | server.profile_on = False | 19 | server.profile_on = False |
251 | 19 | 20 | ||
252 | === modified file 'doc/openerp-web.cfg' | |||
253 | --- doc/openerp-web.cfg 2018-04-25 09:45:33 +0000 | |||
254 | +++ doc/openerp-web.cfg 2018-10-29 09:32:00 +0000 | |||
255 | @@ -13,6 +13,7 @@ | |||
256 | 13 | 13 | ||
257 | 14 | tools.sessions.on = True | 14 | tools.sessions.on = True |
258 | 15 | tools.sessions.persistent = False | 15 | tools.sessions.persistent = False |
259 | 16 | tools.sessions.locking = 'explicit' | ||
260 | 16 | 17 | ||
261 | 17 | # Simple code profiling | 18 | # Simple code profiling |
262 | 18 | server.profile_on = False | 19 | server.profile_on = False |