Merge lp:~jfb-tempo-consulting/unifield-web/jfb-int into lp:unifield-web
- jfb-int
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 4878 |
Proposed branch: | lp:~jfb-tempo-consulting/unifield-web/jfb-int |
Merge into: | lp:unifield-web |
Diff against target: |
803 lines (+307/-50) 26 files modified
addons/openerp/controllers/__init__.py (+1/-0) addons/openerp/controllers/actions.py (+4/-2) addons/openerp/controllers/form.py (+2/-1) addons/openerp/controllers/impex.py (+2/-2) addons/openerp/controllers/search.py (+5/-2) addons/openerp/controllers/shortcut_tooltip.py (+33/-0) addons/openerp/controllers/templates/base.mako (+9/-9) addons/openerp/controllers/templates/exp.mako (+1/-1) addons/openerp/controllers/templates/form.mako (+18/-4) addons/openerp/controllers/templates/header.mako (+1/-5) addons/openerp/controllers/templates/imp.mako (+2/-1) addons/openerp/controllers/templates/index.mako (+3/-0) addons/openerp/controllers/templates/preferences/index.mako (+1/-1) addons/openerp/controllers/templates/shortcut_tooltip.mako (+13/-0) addons/openerp/po/javascript/fr.po (+4/-0) addons/openerp/po/messages/fr.po (+4/-0) addons/openerp/static/css/screen.css (+10/-0) addons/openerp/static/css/tips.css (+19/-0) addons/openerp/static/javascript/form.js (+43/-6) addons/openerp/static/javascript/form_state.js (+14/-7) addons/openerp/static/javascript/listgrid.js (+2/-2) addons/openerp/static/javascript/m2m.js (+3/-1) addons/openerp/static/javascript/m2o.js (+4/-2) addons/openerp/static/javascript/o2m.js (+7/-1) addons/openerp/static/javascript/openerp/openerp.base.js (+2/-1) addons/openerp/static/javascript/web_keyboard_shortcuts.js (+100/-2) |
To merge this branch: | bzr merge lp:~jfb-tempo-consulting/unifield-web/jfb-int |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Dev Team | Pending | ||
Review via email: mp+332850@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 4872. By jftempo
-
US-2937 [IMP] JS code optimization
- 4873. By jftempo
-
US-3589 [FIX] ir.ui.menu bug
- 4874. By jftempo
-
US-2923 [FIX] account.mcdb: don't store the 'original domain' when searching for an existing query as it would lead to an inconsistent SQL request
- 4875. By jftempo
-
US-3211 [FIX] Error message on field validation
- 4876. By jftempo
-
US-3381 [IMP] New attribute auto_refresh on tree view to auto reload page
- 4877. By jftempo
-
US-3172 [IMP] Keyboard shortcuts: popup help
- 4878. By jftempo
-
US-2310 [FIX] Standard Import: keep context
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'addons/openerp/controllers/__init__.py' | |||
2 | --- addons/openerp/controllers/__init__.py 2017-06-19 14:54:07 +0000 | |||
3 | +++ addons/openerp/controllers/__init__.py 2017-10-27 15:15:39 +0000 | |||
4 | @@ -16,6 +16,7 @@ | |||
5 | 16 | import selection | 16 | import selection |
6 | 17 | import shortcuts | 17 | import shortcuts |
7 | 18 | import banner | 18 | import banner |
8 | 19 | import shortcut_tooltip | ||
9 | 19 | import requests | 20 | import requests |
10 | 20 | import unifield_version | 21 | import unifield_version |
11 | 21 | import openm2o | 22 | import openm2o |
12 | 22 | 23 | ||
13 | === modified file 'addons/openerp/controllers/actions.py' | |||
14 | --- addons/openerp/controllers/actions.py 2017-05-16 12:26:11 +0000 | |||
15 | +++ addons/openerp/controllers/actions.py 2017-10-27 15:15:39 +0000 | |||
16 | @@ -65,7 +65,7 @@ | |||
17 | 65 | def execute_window(view_ids, model, res_id=False, domain=None, view_type='form', context=None, | 65 | def execute_window(view_ids, model, res_id=False, domain=None, view_type='form', context=None, |
18 | 66 | mode='form,tree', name=None, target=None, limit=None, search_view=None, | 66 | mode='form,tree', name=None, target=None, limit=None, search_view=None, |
19 | 67 | context_menu=False, display_menu_tip=False, action_id=None, | 67 | context_menu=False, display_menu_tip=False, action_id=None, |
21 | 68 | sidebar_open=False): | 68 | sidebar_open=False, auto_refresh=False): |
22 | 69 | """Performs `actions.act_window` action. | 69 | """Performs `actions.act_window` action. |
23 | 70 | 70 | ||
24 | 71 | @param view_ids: view ids | 71 | @param view_ids: view ids |
25 | @@ -93,6 +93,7 @@ | |||
26 | 93 | params['display_menu_tip'] = display_menu_tip | 93 | params['display_menu_tip'] = display_menu_tip |
27 | 94 | params['sidebar_open'] = sidebar_open | 94 | params['sidebar_open'] = sidebar_open |
28 | 95 | params['target'] = target or None | 95 | params['target'] = target or None |
29 | 96 | params['auto_refresh'] = auto_refresh | ||
30 | 96 | cherrypy.request._terp_view_name = name or None | 97 | cherrypy.request._terp_view_name = name or None |
31 | 97 | cherrypy.request._terp_view_target = target or None | 98 | cherrypy.request._terp_view_target = target or None |
32 | 98 | 99 | ||
33 | @@ -367,7 +368,8 @@ | |||
34 | 367 | context_menu=data.get('context_menu'), | 368 | context_menu=data.get('context_menu'), |
35 | 368 | display_menu_tip=display_menu_tip, | 369 | display_menu_tip=display_menu_tip, |
36 | 369 | action_id=action.get('id'), | 370 | action_id=action.get('id'), |
38 | 370 | sidebar_open=action.get('sidebar_open')) | 371 | sidebar_open=action.get('sidebar_open'), |
39 | 372 | auto_refresh=action.get('auto_refresh')) | ||
40 | 371 | 373 | ||
41 | 372 | def server(action, data): | 374 | def server(action, data): |
42 | 373 | context = dict(data.get('context', {}), | 375 | context = dict(data.get('context', {}), |
43 | 374 | 376 | ||
44 | === modified file 'addons/openerp/controllers/form.py' | |||
45 | --- addons/openerp/controllers/form.py 2017-05-18 12:24:22 +0000 | |||
46 | +++ addons/openerp/controllers/form.py 2017-10-27 15:15:39 +0000 | |||
47 | @@ -273,7 +273,8 @@ | |||
48 | 273 | tips = tips | 273 | tips = tips |
49 | 274 | 274 | ||
50 | 275 | is_dashboard = form.screen.is_dashboard or False | 275 | is_dashboard = form.screen.is_dashboard or False |
52 | 276 | return dict(form=form, pager=pager, buttons=buttons, path=self.path, can_shortcut=can_shortcut, shortcut_ids=shortcut_ids, display_name=display_name, title=title, tips=tips, obj_process=obj_process, is_dashboard=is_dashboard, sidebar_closed=params._terp_sidebar_closed, sidebar_open=params.sidebar_open) | 276 | |
53 | 277 | return dict(form=form, pager=pager, buttons=buttons, path=self.path, can_shortcut=can_shortcut, shortcut_ids=shortcut_ids, display_name=display_name, title=title, tips=tips, obj_process=obj_process, is_dashboard=is_dashboard, sidebar_closed=params._terp_sidebar_closed, sidebar_open=params.sidebar_open, auto_refresh=params.auto_refresh, tg_errors=tg_errors) | ||
54 | 277 | 278 | ||
55 | 278 | @expose('json', methods=('POST',)) | 279 | @expose('json', methods=('POST',)) |
56 | 279 | def close_or_disable_tips(self): | 280 | def close_or_disable_tips(self): |
57 | 280 | 281 | ||
58 | === modified file 'addons/openerp/controllers/impex.py' | |||
59 | --- addons/openerp/controllers/impex.py 2017-01-02 14:59:00 +0000 | |||
60 | +++ addons/openerp/controllers/impex.py 2017-10-27 15:15:39 +0000 | |||
61 | @@ -457,7 +457,7 @@ | |||
62 | 457 | tree.show_headers = False | 457 | tree.show_headers = False |
63 | 458 | return dict(error=error, records=records, success=success, | 458 | return dict(error=error, records=records, success=success, |
64 | 459 | model=params.model, source=params.source, | 459 | model=params.model, source=params.source, |
66 | 460 | tree=tree, fields=kw.get('fields', {})) | 460 | tree=tree, fields=kw.get('fields', {}), ctx=ctx) |
67 | 461 | 461 | ||
68 | 462 | @expose() | 462 | @expose() |
69 | 463 | def detect_data(self, csvfile, csvsep, csvdel, csvcode, csvskip, **kw): | 463 | def detect_data(self, csvfile, csvsep, csvdel, csvcode, csvskip, **kw): |
70 | @@ -566,7 +566,7 @@ | |||
71 | 566 | **kw) | 566 | **kw) |
72 | 567 | 567 | ||
73 | 568 | datas = [] | 568 | datas = [] |
75 | 569 | ctx = dict(rpc.session.context) | 569 | ctx = dict((params.context or {}), **rpc.session.context) |
76 | 570 | 570 | ||
77 | 571 | if not isinstance(fields, list): | 571 | if not isinstance(fields, list): |
78 | 572 | fields = [fields] | 572 | fields = [fields] |
79 | 573 | 573 | ||
80 | === modified file 'addons/openerp/controllers/search.py' | |||
81 | --- addons/openerp/controllers/search.py 2017-02-10 08:28:16 +0000 | |||
82 | +++ addons/openerp/controllers/search.py 2017-10-27 15:15:39 +0000 | |||
83 | @@ -398,8 +398,11 @@ | |||
84 | 398 | ncustom_domain = openobject.i18n.format.convert_date_format_in_domain(ncustom_domain, res, context) | 398 | ncustom_domain = openobject.i18n.format.convert_date_format_in_domain(ncustom_domain, res, context) |
85 | 399 | 399 | ||
86 | 400 | # (US-1360) Get the original domain used, convert it from String to List, and store it in the context | 400 | # (US-1360) Get the original domain used, convert it from String to List, and store it in the context |
89 | 401 | original_domain = all_domains.get('original_domain') and expr_eval(all_domains.get('original_domain')) or [] | 401 | if model != 'account.mcdb': |
90 | 402 | ctx.update({'original_domain': original_domain}) | 402 | # US-2923 When searching for a Saved query in the Selectors don't store the original_domain, otherwise it |
91 | 403 | # would later be used on the account.analytic.lines/account.move.lines and lead to an inconsistent SQL request | ||
92 | 404 | original_domain = all_domains.get('original_domain') and expr_eval(all_domains.get('original_domain')) or [] | ||
93 | 405 | ctx.update({'original_domain': original_domain}) | ||
94 | 403 | 406 | ||
95 | 404 | return dict(domain=ustr(domain), context=ustr(ctx), search_data=ustr(search_data), filter_domain=ustr(ncustom_domain)) | 407 | return dict(domain=ustr(domain), context=ustr(ctx), search_data=ustr(search_data), filter_domain=ustr(ncustom_domain)) |
96 | 405 | 408 | ||
97 | 406 | 409 | ||
98 | === added file 'addons/openerp/controllers/shortcut_tooltip.py' | |||
99 | --- addons/openerp/controllers/shortcut_tooltip.py 1970-01-01 00:00:00 +0000 | |||
100 | +++ addons/openerp/controllers/shortcut_tooltip.py 2017-10-27 15:15:39 +0000 | |||
101 | @@ -0,0 +1,33 @@ | |||
102 | 1 | ############################################################################### | ||
103 | 2 | # | ||
104 | 3 | # Copyright (C) 2007-TODAY OpenERP SA. All Rights Reserved. | ||
105 | 4 | # | ||
106 | 5 | # $Id$ | ||
107 | 6 | # | ||
108 | 7 | # Developed by OpenERP (http://openerp.com) and Axelor (http://axelor.com). | ||
109 | 8 | # | ||
110 | 9 | # The OpenERP web client is distributed under the "OpenERP Public License". | ||
111 | 10 | # It's based on Mozilla Public License Version (MPL) 1.1 with following | ||
112 | 11 | # restrictions: | ||
113 | 12 | # | ||
114 | 13 | # - All names, links and logos of OpenERP must be kept as in original | ||
115 | 14 | # distribution without any changes in all software screens, especially | ||
116 | 15 | # in start-up page and the software header, even if the application | ||
117 | 16 | # source code has been changed or updated or code has been added. | ||
118 | 17 | # | ||
119 | 18 | # You can see the MPL licence at: http://www.mozilla.org/MPL/MPL-1.1.html | ||
120 | 19 | # | ||
121 | 20 | ############################################################################### | ||
122 | 21 | from openerp.controllers import SecuredController | ||
123 | 22 | from openerp.utils import rpc | ||
124 | 23 | |||
125 | 24 | |||
126 | 25 | class ShortcutTooltip(SecuredController): | ||
127 | 26 | |||
128 | 27 | _cp_path = "/openerp/shortcut_tooltip" | ||
129 | 28 | |||
130 | 29 | def get_show_shortcut(self): | ||
131 | 30 | proxy = rpc.RPCProxy('sync.client.entity') | ||
132 | 31 | return proxy.display_shortcut_message() | ||
133 | 32 | |||
134 | 33 | # vim: ts=4 sts=4 sw=4 si et | ||
135 | 0 | 34 | ||
136 | === modified file 'addons/openerp/controllers/templates/base.mako' | |||
137 | --- addons/openerp/controllers/templates/base.mako 2017-09-14 13:33:18 +0000 | |||
138 | +++ addons/openerp/controllers/templates/base.mako 2017-10-27 15:15:39 +0000 | |||
139 | @@ -1,31 +1,31 @@ | |||
140 | 1 | <%inherit file="/openobject/controllers/templates/base.mako"/> | 1 | <%inherit file="/openobject/controllers/templates/base.mako"/> |
141 | 2 | 2 | ||
142 | 3 | <%def name="header()"> | 3 | <%def name="header()"> |
144 | 4 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.base.js?v=6.0"></script> | 4 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.base.js?v=7.0"></script> |
145 | 5 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.js"></script> | 5 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.js"></script> |
146 | 6 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.tips.js"></script> | 6 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.tips.js"></script> |
147 | 7 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.waitbox.js"></script> | 7 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.waitbox.js"></script> |
148 | 8 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.textarea.js"></script> | 8 | <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.textarea.js"></script> |
149 | 9 | 9 | ||
150 | 10 | <script type="text/javascript" src="/openerp/static/javascript/scripts.js"></script> | 10 | <script type="text/javascript" src="/openerp/static/javascript/scripts.js"></script> |
152 | 11 | <script type="text/javascript" src="/openerp/static/javascript/form.js?v=6.0"></script> | 11 | <script type="text/javascript" src="/openerp/static/javascript/form.js?v=7.0"></script> |
153 | 12 | <script type="text/javascript" src="/openerp/static/javascript/form_state.js?v=2.3b2"></script> | 12 | <script type="text/javascript" src="/openerp/static/javascript/form_state.js?v=2.3b2"></script> |
155 | 13 | <script type="text/javascript" src="/openerp/static/javascript/listgrid.js?v=2.8b1"></script> | 13 | <script type="text/javascript" src="/openerp/static/javascript/listgrid.js?v=7.0"></script> |
156 | 14 | 14 | ||
160 | 15 | <script type="text/javascript" src="/openerp/static/javascript/m2o.js?v=2.6b4"></script> | 15 | <script type="text/javascript" src="/openerp/static/javascript/m2o.js?v=7.0"></script> |
161 | 16 | <script type="text/javascript" src="/openerp/static/javascript/m2m.js"></script> | 16 | <script type="text/javascript" src="/openerp/static/javascript/m2m.js?v=7.0"></script> |
162 | 17 | <script type="text/javascript" src="/openerp/static/javascript/o2m.js"></script> | 17 | <script type="text/javascript" src="/openerp/static/javascript/o2m.js?v=7.0"></script> |
163 | 18 | <script type="text/javascript" src="/openerp/static/javascript/binary.js"></script> | 18 | <script type="text/javascript" src="/openerp/static/javascript/binary.js"></script> |
164 | 19 | <script type="text/javascript" src="/openerp/static/jscal/calendar.js"></script> | 19 | <script type="text/javascript" src="/openerp/static/jscal/calendar.js"></script> |
165 | 20 | <script type="text/javascript" src="/openerp/static/jscal/calendar-setup.js"></script> | 20 | <script type="text/javascript" src="/openerp/static/jscal/calendar-setup.js"></script> |
166 | 21 | 21 | ||
168 | 22 | <script type="text/javascript" src="/openerp/static/javascript/web_keyboard_shortcuts.js"></script> | 22 | <script type="text/javascript" src="/openerp/static/javascript/web_keyboard_shortcuts.js?v=7.0"></script> |
169 | 23 | 23 | ||
170 | 24 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/style.css"/> | 24 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/style.css"/> |
171 | 25 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/menu.css?v=2.7b1"/> | 25 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/menu.css?v=2.7b1"/> |
173 | 26 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/tips.css"/> | 26 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/tips.css?v=7.0"/> |
174 | 27 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/waitbox.css"/> | 27 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/waitbox.css"/> |
176 | 28 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/screen.css?v=2.7b1"/> | 28 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/screen.css?v=7.0"/> |
177 | 29 | 29 | ||
178 | 30 | <link rel="stylesheet" type="text/css" href="/openerp/static/jscal/calendar-blue.css"/> | 30 | <link rel="stylesheet" type="text/css" href="/openerp/static/jscal/calendar-blue.css"/> |
179 | 31 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/dashboard.css"/> | 31 | <link rel="stylesheet" type="text/css" href="/openerp/static/css/dashboard.css"/> |
180 | 32 | 32 | ||
181 | === modified file 'addons/openerp/controllers/templates/exp.mako' | |||
182 | --- addons/openerp/controllers/templates/exp.mako 2017-08-29 09:33:08 +0000 | |||
183 | +++ addons/openerp/controllers/templates/exp.mako 2017-10-27 15:15:39 +0000 | |||
184 | @@ -286,7 +286,7 @@ | |||
185 | 286 | <table width="100%"> | 286 | <table width="100%"> |
186 | 287 | <tr> | 287 | <tr> |
187 | 288 | <td class="imp-header" align="right"> | 288 | <td class="imp-header" align="right"> |
189 | 289 | <a class="button-a" href="javascript: void(0)" onclick="window.frameElement.close()">${_("Cancel")}</a> | 289 | <a class="button-a oe_form_button_cancel" href="javascript: void(0)" onclick="window.frameElement.close()">${_("Cancel")}</a> |
190 | 290 | <a class="button-a" href="javascript: void(0)" onclick="do_export('view_form')">${_("Export to File")}</a> | 290 | <a class="button-a" href="javascript: void(0)" onclick="do_export('view_form')">${_("Export to File")}</a> |
191 | 291 | </td> | 291 | </td> |
192 | 292 | <td width="5%"></td> | 292 | <td width="5%"></td> |
193 | 293 | 293 | ||
194 | === modified file 'addons/openerp/controllers/templates/form.mako' | |||
195 | --- addons/openerp/controllers/templates/form.mako 2017-06-01 13:48:36 +0000 | |||
196 | +++ addons/openerp/controllers/templates/form.mako 2017-10-27 15:15:39 +0000 | |||
197 | @@ -25,6 +25,15 @@ | |||
198 | 25 | /* | 25 | /* |
199 | 26 | % endif | 26 | % endif |
200 | 27 | */ | 27 | */ |
201 | 28 | /* | ||
202 | 29 | % if auto_refresh : | ||
203 | 30 | */ | ||
204 | 31 | setTimeout(function() { | ||
205 | 32 | location.reload(); | ||
206 | 33 | }, ${auto_refresh}*1000); | ||
207 | 34 | /* | ||
208 | 35 | % endif | ||
209 | 36 | */ | ||
210 | 28 | setTimeout(function() { | 37 | setTimeout(function() { |
211 | 29 | jQuery('[autofocus="autofocus"]').focus(); | 38 | jQuery('[autofocus="autofocus"]').focus(); |
212 | 30 | }, 10); | 39 | }, 10); |
213 | @@ -95,10 +104,10 @@ | |||
214 | 95 | % endif | 104 | % endif |
215 | 96 | 105 | ||
216 | 97 | % if obj_process: | 106 | % if obj_process: |
221 | 98 | <a class="help" href="${py.url('/view_diagram/process', res_model=form.screen.model, title=form.screen.string, res_id=form.screen.id)}" | 107 | <a class="help" href="${py.url('/view_diagram/process', res_model=form.screen.model, title=form.screen.string, res_id=form.screen.id)}" |
222 | 99 | title="${_('Corporate Intelligence...')}"> | 108 | title="${_('Corporate Intelligence...')}"> |
223 | 100 | <small>Help</small> | 109 | <small>Help</small> |
224 | 101 | </a> | 110 | </a> |
225 | 102 | % endif | 111 | % endif |
226 | 103 | % if form.screen.view_type == 'form' and form.logs.logs: | 112 | % if form.screen.view_type == 'form' and form.logs.logs: |
227 | 104 | <a id="show_server_logs" class="logs" href="javascript: void(0)" | 113 | <a id="show_server_logs" class="logs" href="javascript: void(0)" |
228 | @@ -166,6 +175,7 @@ | |||
229 | 166 | % if buttons.pager: | 175 | % if buttons.pager: |
230 | 167 | ${pager.display()} | 176 | ${pager.display()} |
231 | 168 | % endif | 177 | % endif |
232 | 178 | |||
233 | 169 | </div> | 179 | </div> |
234 | 170 | % endif | 180 | % endif |
235 | 171 | <div${ " class='non-editable'" if not form.screen.editable and form.screen.view_type == 'form' else "" | n }>${form.display()}</div> | 181 | <div${ " class='non-editable'" if not form.screen.editable and form.screen.view_type == 'form' else "" | n }>${form.display()}</div> |
236 | @@ -209,6 +219,10 @@ | |||
237 | 209 | $hide.click(); | 219 | $hide.click(); |
238 | 210 | return false; | 220 | return false; |
239 | 211 | }) | 221 | }) |
240 | 222 | |||
241 | 223 | % if tg_errors: | ||
242 | 224 | error_display(_("The form contains errors.")); | ||
243 | 225 | % endif | ||
244 | 212 | }) | 226 | }) |
245 | 213 | </script> | 227 | </script> |
246 | 214 | </%def> | 228 | </%def> |
247 | 215 | 229 | ||
248 | === modified file 'addons/openerp/controllers/templates/header.mako' | |||
249 | --- addons/openerp/controllers/templates/header.mako 2016-06-14 16:01:53 +0000 | |||
250 | +++ addons/openerp/controllers/templates/header.mako 2017-10-27 15:15:39 +0000 | |||
251 | @@ -4,7 +4,6 @@ | |||
252 | 4 | ROOT = cp.request.pool.get_controller("/openerp") | 4 | ROOT = cp.request.pool.get_controller("/openerp") |
253 | 5 | SHORTCUTS = cp.request.pool.get_controller("/openerp/shortcuts") | 5 | SHORTCUTS = cp.request.pool.get_controller("/openerp/shortcuts") |
254 | 6 | REQUESTS = cp.request.pool.get_controller("/openerp/requests") | 6 | REQUESTS = cp.request.pool.get_controller("/openerp/requests") |
255 | 7 | UF_VERSION = cp.request.pool.get_controller("/openerp/unifield_version") | ||
256 | 8 | 7 | ||
257 | 9 | shortcuts = SHORTCUTS.my() | 8 | shortcuts = SHORTCUTS.my() |
258 | 10 | requests, total_request = REQUESTS.my() | 9 | requests, total_request = REQUESTS.my() |
259 | @@ -30,9 +29,6 @@ | |||
260 | 30 | add_style = cp.config('server.environment') in css_style_dict.keys() | 29 | add_style = cp.config('server.environment') in css_style_dict.keys() |
261 | 31 | if add_style: | 30 | if add_style: |
262 | 32 | css_style = css_style_dict.get(cp.config('server.environment'), "") | 31 | css_style = css_style_dict.get(cp.config('server.environment'), "") |
263 | 33 | |||
264 | 34 | from openobject import release | ||
265 | 35 | version = release.version | ||
266 | 36 | %> | 32 | %> |
267 | 37 | <td id="top" | 33 | <td id="top" |
268 | 38 | % if add_style: | 34 | % if add_style: |
269 | @@ -153,6 +149,6 @@ | |||
270 | 153 | src:this.href | 149 | src:this.href |
271 | 154 | }, null, { | 150 | }, null, { |
272 | 155 | height: 350 | 151 | height: 350 |
274 | 156 | }); | 152 | }).focus(); |
275 | 157 | }); | 153 | }); |
276 | 158 | </script> | 154 | </script> |
277 | 159 | 155 | ||
278 | === modified file 'addons/openerp/controllers/templates/imp.mako' | |||
279 | --- addons/openerp/controllers/templates/imp.mako 2015-10-23 08:08:51 +0000 | |||
280 | +++ addons/openerp/controllers/templates/imp.mako 2017-10-27 15:15:39 +0000 | |||
281 | @@ -71,6 +71,7 @@ | |||
282 | 71 | <input type="hidden" id="_terp_model" name="_terp_model" value="${model}"/> | 71 | <input type="hidden" id="_terp_model" name="_terp_model" value="${model}"/> |
283 | 72 | <input type="hidden" id="_terp_ids" name="_terp_ids" value="[]"/> | 72 | <input type="hidden" id="_terp_ids" name="_terp_ids" value="[]"/> |
284 | 73 | <input type="hidden" id="_terp_fields2" name="_terp_fields2" value="[]"/> | 73 | <input type="hidden" id="_terp_fields2" name="_terp_fields2" value="[]"/> |
285 | 74 | <input type="hidden" id="_terp_context" name="_terp_context" value="${ctx}"/> | ||
286 | 74 | 75 | ||
287 | 75 | <table class="view" cellspacing="5" border="0" width="100%"> | 76 | <table class="view" cellspacing="5" border="0" width="100%"> |
288 | 76 | <tr> | 77 | <tr> |
289 | @@ -202,7 +203,7 @@ | |||
290 | 202 | <table width="100%"> | 203 | <table width="100%"> |
291 | 203 | <tr> | 204 | <tr> |
292 | 204 | <td class="imp-header" align="left"> | 205 | <td class="imp-header" align="left"> |
294 | 205 | <a class="button-a" href="javascript: void(0)" onclick="window.frameElement.close()">${_("Close")}</a> | 206 | <a class="button-a oe_form_button_cancel" href="javascript: void(0)" onclick="window.frameElement.close()">${_("Close")}</a> |
295 | 206 | <a class="button-a" href="javascript: void(0)" onclick="do_import();">${_("Import File")}</a> | 207 | <a class="button-a" href="javascript: void(0)" onclick="do_import();">${_("Import File")}</a> |
296 | 207 | </td> | 208 | </td> |
297 | 208 | <td width="5%"></td> | 209 | <td width="5%"></td> |
298 | 209 | 210 | ||
299 | === modified file 'addons/openerp/controllers/templates/index.mako' | |||
300 | --- addons/openerp/controllers/templates/index.mako 2017-06-19 14:54:07 +0000 | |||
301 | +++ addons/openerp/controllers/templates/index.mako 2017-10-27 15:15:39 +0000 | |||
302 | @@ -94,6 +94,9 @@ | |||
303 | 94 | <tr> | 94 | <tr> |
304 | 95 | <%include file="banner.mako"/> | 95 | <%include file="banner.mako"/> |
305 | 96 | </tr> | 96 | </tr> |
306 | 97 | <tr> | ||
307 | 98 | <%include file="shortcut_tooltip.mako"/> | ||
308 | 99 | </tr> | ||
309 | 97 | % if tools is not None: | 100 | % if tools is not None: |
310 | 98 | <tr> | 101 | <tr> |
311 | 99 | <td id="secondary" class="sidenav-open"> | 102 | <td id="secondary" class="sidenav-open"> |
312 | 100 | 103 | ||
313 | === modified file 'addons/openerp/controllers/templates/preferences/index.mako' | |||
314 | --- addons/openerp/controllers/templates/preferences/index.mako 2016-11-21 09:45:23 +0000 | |||
315 | +++ addons/openerp/controllers/templates/preferences/index.mako 2017-10-27 15:15:39 +0000 | |||
316 | @@ -35,7 +35,7 @@ | |||
317 | 35 | <button type='button' class="static_boxes" | 35 | <button type='button' class="static_boxes" |
318 | 36 | onclick="open_password(); return false;" | 36 | onclick="open_password(); return false;" |
319 | 37 | >${_("Change Password")}</button> | 37 | >${_("Change Password")}</button> |
321 | 38 | <button type='button' class="static_boxes" onclick="window.frameElement.close();">${_("Cancel")}</button> | 38 | <button type='button' class="static_boxes oe_form_button_cancel" onclick="window.frameElement.close();">${_("Cancel")}</button> |
322 | 39 | <button type='button' class="static_boxes" onclick="submit_form('ok');">${_("Save")}</button> | 39 | <button type='button' class="static_boxes" onclick="submit_form('ok');">${_("Save")}</button> |
323 | 40 | </td> | 40 | </td> |
324 | 41 | </tr> | 41 | </tr> |
325 | 42 | 42 | ||
326 | === added file 'addons/openerp/controllers/templates/shortcut_tooltip.mako' | |||
327 | --- addons/openerp/controllers/templates/shortcut_tooltip.mako 1970-01-01 00:00:00 +0000 | |||
328 | +++ addons/openerp/controllers/templates/shortcut_tooltip.mako 2017-10-27 15:15:39 +0000 | |||
329 | @@ -0,0 +1,13 @@ | |||
330 | 1 | <% | ||
331 | 2 | # put in try block to prevent improper redirection on connection refuse error | ||
332 | 3 | try: | ||
333 | 4 | SHORTCUT = cp.request.pool.get_controller("/openerp/shortcut_tooltip") | ||
334 | 5 | display_message = SHORTCUT.get_show_shortcut() | ||
335 | 6 | message = _("You haven't recently used a keyboard shortcut. You can see what shortcuts are available on this screen by holding SHIFT + CTRL.") | ||
336 | 7 | except: | ||
337 | 8 | display_message = False | ||
338 | 9 | message = 'toto' | ||
339 | 10 | %> | ||
340 | 11 | % if display_message: | ||
341 | 12 | <td id="shortcut_message" colspan="3">${message | h}</td> | ||
342 | 13 | % endif | ||
343 | 0 | 14 | ||
344 | === modified file 'addons/openerp/po/javascript/fr.po' | |||
345 | --- addons/openerp/po/javascript/fr.po 2017-02-06 11:21:15 +0000 | |||
346 | +++ addons/openerp/po/javascript/fr.po 2017-10-27 15:15:39 +0000 | |||
347 | @@ -114,3 +114,7 @@ | |||
348 | 114 | #: static/javascript/form.js | 114 | #: static/javascript/form.js |
349 | 115 | msgid "You cannot upload files bigger than %(max_size)sMB, current size is %(size)sMB" | 115 | msgid "You cannot upload files bigger than %(max_size)sMB, current size is %(size)sMB" |
350 | 116 | msgstr "Vous ne pouvez pas envoyer des fichiers plus gros que %(max_size)sMB, la taille actuelle est de %(size)sMB" | 116 | msgstr "Vous ne pouvez pas envoyer des fichiers plus gros que %(max_size)sMB, la taille actuelle est de %(size)sMB" |
351 | 117 | |||
352 | 118 | #: addons/openerp/controllers/templates/form.mako | ||
353 | 119 | msgid "The form contains errors." | ||
354 | 120 | msgstr "Le formulaire comporte des erreurs." | ||
355 | 117 | 121 | ||
356 | === modified file 'addons/openerp/po/messages/fr.po' | |||
357 | --- addons/openerp/po/messages/fr.po 2017-01-02 14:59:00 +0000 | |||
358 | +++ addons/openerp/po/messages/fr.po 2017-10-27 15:15:39 +0000 | |||
359 | @@ -1775,3 +1775,7 @@ | |||
360 | 1775 | #~ msgid "Click here to add new image." | 1775 | #~ msgid "Click here to add new image." |
361 | 1776 | #~ msgstr "Cliquez ici pour ajouter une nouvelle image" | 1776 | #~ msgstr "Cliquez ici pour ajouter une nouvelle image" |
362 | 1777 | 1777 | ||
363 | 1778 | #: controllers/templates/shortcut_tooltip.mako:6 | ||
364 | 1779 | #, python-format | ||
365 | 1780 | msgid "You haven't recently used a keyboard shortcut. You can see what shortcuts are available on this screen by holding SHIFT + CTRL." | ||
366 | 1781 | msgstr "Vous n'avez pas utilisé de raccourci clavier récemment. Vous pouvez voir quels raccourcis sont disponibles sur cet écran en utilisant CTRL + SHIFT." | ||
367 | 1778 | 1782 | ||
368 | === modified file 'addons/openerp/static/css/screen.css' | |||
369 | --- addons/openerp/static/css/screen.css 2017-07-10 08:56:45 +0000 | |||
370 | +++ addons/openerp/static/css/screen.css 2017-10-27 15:15:39 +0000 | |||
371 | @@ -2378,3 +2378,13 @@ | |||
372 | 2378 | background: rgba(255, 165, 0, .6); | 2378 | background: rgba(255, 165, 0, .6); |
373 | 2379 | white-space: pre-line; | 2379 | white-space: pre-line; |
374 | 2380 | } | 2380 | } |
375 | 2381 | |||
376 | 2382 | #shortcut_message { | ||
377 | 2383 | font-weight: bold; | ||
378 | 2384 | font-size: 1.2em; | ||
379 | 2385 | height: 2em; | ||
380 | 2386 | text-align: center; | ||
381 | 2387 | background: rgb(184, 222, 130); | ||
382 | 2388 | background: rgba(184, 222, 130, .6); | ||
383 | 2389 | white-space: pre-line; | ||
384 | 2390 | } | ||
385 | 2381 | 2391 | ||
386 | === modified file 'addons/openerp/static/css/tips.css' | |||
387 | --- addons/openerp/static/css/tips.css 2010-11-23 10:11:52 +0000 | |||
388 | +++ addons/openerp/static/css/tips.css 2017-10-27 15:15:39 +0000 | |||
389 | @@ -39,3 +39,22 @@ | |||
390 | 39 | font-size: 12px; | 39 | font-size: 12px; |
391 | 40 | } | 40 | } |
392 | 41 | 41 | ||
393 | 42 | |||
394 | 43 | .shortcut_tooltip { | ||
395 | 44 | padding: 4px; | ||
396 | 45 | text-align: center; | ||
397 | 46 | font-family: sans-serif; | ||
398 | 47 | font-size: 11px; | ||
399 | 48 | color: #666666; | ||
400 | 49 | z-index: 1000; | ||
401 | 50 | border-radius: 6px; | ||
402 | 51 | -moz-border-radius: 6px; | ||
403 | 52 | -webkit-border-radius: 6px; | ||
404 | 53 | background: #FCF9A7; | ||
405 | 54 | border: 1px solid #999; | ||
406 | 55 | max-width: 500px; | ||
407 | 56 | opacity: 1; | ||
408 | 57 | -webkit-transition: opacity 1000ms linear; | ||
409 | 58 | transition: opacity 1000ms linear; | ||
410 | 59 | font-weight: bold; | ||
411 | 60 | } | ||
412 | 42 | 61 | ||
413 | === modified file 'addons/openerp/static/javascript/form.js' | |||
414 | --- addons/openerp/static/javascript/form.js 2017-10-20 13:34:27 +0000 | |||
415 | +++ addons/openerp/static/javascript/form.js 2017-10-27 15:15:39 +0000 | |||
416 | @@ -97,6 +97,27 @@ | |||
417 | 97 | 97 | ||
418 | 98 | var prefix = src && src != '_terp_list' ? src + '/' : ''; | 98 | var prefix = src && src != '_terp_list' ? src + '/' : ''; |
419 | 99 | 99 | ||
420 | 100 | // Here we do a sanity check that there aren't multiple element with | ||
421 | 101 | // the same id 'prefix/_terp_model' | ||
422 | 102 | // If this is the case, we introduce some delay (call back the same | ||
423 | 103 | // function later) | ||
424 | 104 | // | ||
425 | 105 | // This can happen in some asynchronous edge-case where the DOM is not | ||
426 | 106 | // fully loaded yet and in particular there's a remaining element with | ||
427 | 107 | // _terp_model = ir.ui.menu | ||
428 | 108 | // which might trigger the opening of a completely unrealted view | ||
429 | 109 | // | ||
430 | 110 | // You might reproduce the issue by monitoring the value of | ||
431 | 111 | // openobject.dom.get(prefix + '_terp_model').value | ||
432 | 112 | // when loading for instance the list of Commitment Vouchers | ||
433 | 113 | // | ||
434 | 114 | // See https://jira.unifield.org/browse/US-3589 | ||
435 | 115 | // | ||
436 | 116 | if ($("[id="+prefix+"_terp_model]").length > 1) { | ||
437 | 117 | callLater(0.1, openRecord, id, src, target, readonly); | ||
438 | 118 | return; | ||
439 | 119 | } | ||
440 | 120 | |||
441 | 100 | var args = { | 121 | var args = { |
442 | 101 | 'model': openobject.dom.get(prefix + '_terp_model').value, | 122 | 'model': openobject.dom.get(prefix + '_terp_model').value, |
443 | 102 | 'id': id || 'False', | 123 | 'id': id || 'False', |
444 | @@ -255,11 +276,11 @@ | |||
445 | 255 | } | 276 | } |
446 | 256 | 277 | ||
447 | 257 | 278 | ||
449 | 258 | function error_display(msg) { | 279 | function error_display(msg, title='Warning Message') { |
450 | 259 | var error = jQuery("<table>",{'width': '100%', 'height': '100%'} | 280 | var error = jQuery("<table>",{'width': '100%', 'height': '100%'} |
451 | 260 | ).append( | 281 | ).append( |
452 | 261 | jQuery("<tr>").append( | 282 | jQuery("<tr>").append( |
454 | 262 | jQuery("<td>", {'colspan': 2, 'class': 'error_message_header'}).text(_('Warning Message')) | 283 | jQuery("<td>", {'colspan': 2, 'class': 'error_message_header'}).text(_(title)) |
455 | 263 | ), | 284 | ), |
456 | 264 | jQuery("<tr>").append( | 285 | jQuery("<tr>").append( |
457 | 265 | jQuery("<td>", {'css': 'padding: 4px 2px;'}).append( | 286 | jQuery("<td>", {'css': 'padding: 4px 2px;'}).append( |
458 | @@ -275,7 +296,13 @@ | |||
459 | 275 | .text('OK') | 296 | .text('OK') |
460 | 276 | ) | 297 | ) |
461 | 277 | )); | 298 | )); |
463 | 278 | window.top.jQuery.fancybox(error, {scrolling: 'no'}); | 299 | error.find('.button-a').focus() |
464 | 300 | window.top.jQuery.fancybox(error, { | ||
465 | 301 | scrolling: 'no', | ||
466 | 302 | onComplete: function () { | ||
467 | 303 | $(this).find(".button-a").focus() | ||
468 | 304 | } | ||
469 | 305 | }); | ||
470 | 279 | } | 306 | } |
471 | 280 | 307 | ||
472 | 281 | function get_sidebar_status(args, noterp) { | 308 | function get_sidebar_status(args, noterp) { |
473 | @@ -1022,7 +1049,18 @@ | |||
474 | 1022 | } | 1049 | } |
475 | 1023 | 1050 | ||
476 | 1024 | if (obj.error) { | 1051 | if (obj.error) { |
478 | 1025 | return error_popup(obj.error) | 1052 | // 'TinyForm' error case : obj.error is a string |
479 | 1053 | if (obj.error_field) { | ||
480 | 1054 | // Retrieve the label associated to the label and display the | ||
481 | 1055 | // error | ||
482 | 1056 | var error_field_label = $('label[for="'+obj.error_field+'"]').text().trim() | ||
483 | 1057 | return error_display(error_field_label+" : "+obj.error); | ||
484 | 1058 | } | ||
485 | 1059 | // General exception case (no obj.error_field given) | ||
486 | 1060 | // obj.error is a full HTML page (and error_popup will display it) | ||
487 | 1061 | else { | ||
488 | 1062 | return error_popup(obj); | ||
489 | 1063 | } | ||
490 | 1026 | } | 1064 | } |
491 | 1027 | 1065 | ||
492 | 1028 | return obj; | 1066 | return obj; |
493 | @@ -1404,9 +1442,8 @@ | |||
494 | 1404 | dataType: 'json', | 1442 | dataType: 'json', |
495 | 1405 | success: function(obj) { | 1443 | success: function(obj) { |
496 | 1406 | if(obj.error) { | 1444 | if(obj.error) { |
498 | 1407 | error_popup(obj.error); | 1445 | error_display(obj.error); |
499 | 1408 | } | 1446 | } |
500 | 1409 | |||
501 | 1410 | $attachment_line.remove(); | 1447 | $attachment_line.remove(); |
502 | 1411 | } | 1448 | } |
503 | 1412 | }); | 1449 | }); |
504 | 1413 | 1450 | ||
505 | === modified file 'addons/openerp/static/javascript/form_state.js' | |||
506 | --- addons/openerp/static/javascript/form_state.js 2017-10-19 14:33:30 +0000 | |||
507 | +++ addons/openerp/static/javascript/form_state.js 2017-10-27 15:15:39 +0000 | |||
508 | @@ -190,11 +190,19 @@ | |||
509 | 190 | } | 190 | } |
510 | 191 | 191 | ||
511 | 192 | function list_hookAttrChange(list_name) { | 192 | function list_hookAttrChange(list_name) { |
514 | 193 | jQuery('table[id='+list_name+'_grid] [attrs]').each(function () { | 193 | |
515 | 194 | var $this = jQuery(this); | 194 | // check if an editor exists |
516 | 195 | var editor_exists = $(".editors").length; | ||
517 | 196 | |||
518 | 197 | // Loop on list elements which have an 'attrs' attribute | ||
519 | 198 | var listgrids = jQuery('table[id='+list_name+'_grid] [attrs]'); | ||
520 | 199 | for (var i = 0 ; i < listgrids.length ; i++) | ||
521 | 200 | { | ||
522 | 201 | var elem = listgrids[i]; | ||
523 | 202 | var $this = jQuery(elem); | ||
524 | 195 | var attrs = $this.attr('attrs') || '{}'; | 203 | var attrs = $this.attr('attrs') || '{}'; |
525 | 196 | var widget = $this.attr('widget') || ''; | 204 | var widget = $this.attr('widget') || ''; |
527 | 197 | var container = this; | 205 | var container = elem; |
528 | 198 | var prefix = widget.slice(0, widget.lastIndexOf('/')+1) || ''; | 206 | var prefix = widget.slice(0, widget.lastIndexOf('/')+1) || ''; |
529 | 199 | 207 | ||
530 | 200 | // Convert Python statement into it's equivalent in JavaScript. | 208 | // Convert Python statement into it's equivalent in JavaScript. |
531 | @@ -207,11 +215,9 @@ | |||
532 | 207 | try { | 215 | try { |
533 | 208 | attrs = eval('(' + attrs + ')'); | 216 | attrs = eval('(' + attrs + ')'); |
534 | 209 | } catch(e){ | 217 | } catch(e){ |
536 | 210 | return; | 218 | continue; |
537 | 211 | } | 219 | } |
538 | 212 | 220 | ||
539 | 213 | // check if an editor exists | ||
540 | 214 | var editor_exists = $(".editors").length; | ||
541 | 215 | var cache_values = {}; | 221 | var cache_values = {}; |
542 | 216 | 222 | ||
543 | 217 | var row_is_editable = editor_exists && $this.parents('tr.grid-row').is('.editors'); | 223 | var row_is_editable = editor_exists && $this.parents('tr.grid-row').is('.editors'); |
544 | @@ -225,6 +231,7 @@ | |||
545 | 225 | return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values); | 231 | return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values); |
546 | 226 | } | 232 | } |
547 | 227 | forEach(attrs[attr], function(n) { | 233 | forEach(attrs[attr], function(n) { |
548 | 234 | |||
549 | 228 | if (typeof(n) == "number") { // {'invisible': [1]} | 235 | if (typeof(n) == "number") { // {'invisible': [1]} |
550 | 229 | return form_onAttrChange(container, widget, attr, n, $this, cache_values); | 236 | return form_onAttrChange(container, widget, attr, n, $this, cache_values); |
551 | 230 | } | 237 | } |
552 | @@ -237,7 +244,7 @@ | |||
553 | 237 | return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values); | 244 | return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values); |
554 | 238 | }); | 245 | }); |
555 | 239 | } | 246 | } |
557 | 240 | }); | 247 | }; |
558 | 241 | } | 248 | } |
559 | 242 | 249 | ||
560 | 243 | function form_onAttrChange(container, widgetName, attr, expr, elem, cache_values) { | 250 | function form_onAttrChange(container, widgetName, attr, expr, elem, cache_values) { |
561 | 244 | 251 | ||
562 | === modified file 'addons/openerp/static/javascript/listgrid.js' | |||
563 | --- addons/openerp/static/javascript/listgrid.js 2017-10-16 09:48:57 +0000 | |||
564 | +++ addons/openerp/static/javascript/listgrid.js 2017-10-27 15:15:39 +0000 | |||
565 | @@ -1155,7 +1155,7 @@ | |||
566 | 1155 | }, null, { | 1155 | }, null, { |
567 | 1156 | height: '98%', | 1156 | height: '98%', |
568 | 1157 | max_height: 600 | 1157 | max_height: 600 |
570 | 1158 | }); | 1158 | }).focus(); |
571 | 1159 | }, | 1159 | }, |
572 | 1160 | 1160 | ||
573 | 1161 | importData: function() { | 1161 | importData: function() { |
574 | @@ -1169,7 +1169,7 @@ | |||
575 | 1169 | height: '98%', | 1169 | height: '98%', |
576 | 1170 | max_height: 550, | 1170 | max_height: 550, |
577 | 1171 | width: '95%' | 1171 | width: '95%' |
579 | 1172 | }); | 1172 | }).focus(); |
580 | 1173 | } | 1173 | } |
581 | 1174 | }); | 1174 | }); |
582 | 1175 | 1175 | ||
583 | 1176 | 1176 | ||
584 | === modified file 'addons/openerp/static/javascript/m2m.js' | |||
585 | --- addons/openerp/static/javascript/m2m.js 2017-01-02 14:59:00 +0000 | |||
586 | +++ addons/openerp/static/javascript/m2m.js 2017-10-27 15:15:39 +0000 | |||
587 | @@ -190,7 +190,7 @@ | |||
588 | 190 | } else { | 190 | } else { |
589 | 191 | url = '/openerp/search/new'; | 191 | url = '/openerp/search/new'; |
590 | 192 | } | 192 | } |
592 | 193 | return $.frame_dialog({ | 193 | var $frame = $.frame_dialog({ |
593 | 194 | src: openobject.http.getURL(url, options) | 194 | src: openobject.http.getURL(url, options) |
594 | 195 | }, { | 195 | }, { |
595 | 196 | 'source-window': $this[0], | 196 | 'source-window': $this[0], |
596 | @@ -199,6 +199,8 @@ | |||
597 | 199 | width: '90%', | 199 | width: '90%', |
598 | 200 | height: '95%' | 200 | height: '95%' |
599 | 201 | }); | 201 | }); |
600 | 202 | $frame.focus(); | ||
601 | 203 | return $frame; | ||
602 | 202 | } | 204 | } |
603 | 203 | 205 | ||
604 | 204 | /** | 206 | /** |
605 | 205 | 207 | ||
606 | === modified file 'addons/openerp/static/javascript/m2o.js' | |||
607 | --- addons/openerp/static/javascript/m2o.js 2017-06-01 13:48:36 +0000 | |||
608 | +++ addons/openerp/static/javascript/m2o.js 2017-10-27 15:15:39 +0000 | |||
609 | @@ -606,7 +606,7 @@ | |||
610 | 606 | } else { | 606 | } else { |
611 | 607 | url = '/openerp/search/new'; | 607 | url = '/openerp/search/new'; |
612 | 608 | } | 608 | } |
614 | 609 | return $.frame_dialog({ | 609 | var $frame = $.frame_dialog({ |
615 | 610 | src: openobject.http.getURL(url, options) | 610 | src: openobject.http.getURL(url, options) |
616 | 611 | }, { | 611 | }, { |
617 | 612 | 'source-window': $this[0], | 612 | 'source-window': $this[0], |
618 | @@ -616,6 +616,8 @@ | |||
619 | 616 | max_width: 1200, | 616 | max_width: 1200, |
620 | 617 | height: '95%' | 617 | height: '95%' |
621 | 618 | }); | 618 | }); |
622 | 619 | $frame.focus(); | ||
623 | 620 | return $frame; | ||
624 | 619 | } | 621 | } |
625 | 620 | 622 | ||
626 | 621 | /** | 623 | /** |
627 | @@ -681,7 +683,7 @@ | |||
628 | 681 | if(arguments[0] === "close") { | 683 | if(arguments[0] === "close") { |
629 | 682 | return close($this, arguments[1]); | 684 | return close($this, arguments[1]); |
630 | 683 | } else { | 685 | } else { |
632 | 684 | return open($this, arguments[0]); | 686 | return open($this, arguments[0]).focus(); |
633 | 685 | } | 687 | } |
634 | 686 | }; | 688 | }; |
635 | 687 | })(jQuery); | 689 | })(jQuery); |
636 | 688 | 690 | ||
637 | === modified file 'addons/openerp/static/javascript/o2m.js' | |||
638 | --- addons/openerp/static/javascript/o2m.js 2017-10-20 13:34:27 +0000 | |||
639 | +++ addons/openerp/static/javascript/o2m.js 2017-10-27 15:15:39 +0000 | |||
640 | @@ -260,7 +260,13 @@ | |||
641 | 260 | }); | 260 | }); |
642 | 261 | $frame.load(function() { | 261 | $frame.load(function() { |
643 | 262 | $frame_content = $frame.contents(); | 262 | $frame_content = $frame.contents(); |
645 | 263 | $frame_content.find("[autofocus='autofocus']").focus(); | 263 | if ($frame_content.find("[autofocus='autofocus']").lenght) { |
646 | 264 | // if a field have an autofocus attribute, set the focus on it | ||
647 | 265 | $frame_content.find("[autofocus='autofocus']").focus(); | ||
648 | 266 | } | ||
649 | 267 | else { | ||
650 | 268 | $frame.focus(); // set the focus on the whole frame | ||
651 | 269 | } | ||
652 | 264 | }); | 270 | }); |
653 | 265 | var $form = jQuery('<form>', { | 271 | var $form = jQuery('<form>', { |
654 | 266 | method: 'POST', | 272 | method: 'POST', |
655 | 267 | 273 | ||
656 | === modified file 'addons/openerp/static/javascript/openerp/openerp.base.js' | |||
657 | --- addons/openerp/static/javascript/openerp/openerp.base.js 2017-10-17 09:38:02 +0000 | |||
658 | +++ addons/openerp/static/javascript/openerp/openerp.base.js 2017-10-27 15:15:39 +0000 | |||
659 | @@ -193,13 +193,14 @@ | |||
660 | 193 | var $dialogs = jQuery('.action-dialog'); | 193 | var $dialogs = jQuery('.action-dialog'); |
661 | 194 | switch(target) { | 194 | switch(target) { |
662 | 195 | case 'new': | 195 | case 'new': |
664 | 196 | jQuery.frame_dialog({ | 196 | $frame = jQuery.frame_dialog({ |
665 | 197 | src: action_url, | 197 | src: action_url, |
666 | 198 | 'class': 'action-dialog' | 198 | 'class': 'action-dialog' |
667 | 199 | }, null, { | 199 | }, null, { |
668 | 200 | width: '90%', | 200 | width: '90%', |
669 | 201 | height: '95%' | 201 | height: '95%' |
670 | 202 | }); | 202 | }); |
671 | 203 | $frame.focus(); | ||
672 | 203 | if (terp_id && !$dialogs.length) { | 204 | if (terp_id && !$dialogs.length) { |
673 | 204 | if (jQuery('#_terp_id').val() == 'False') { | 205 | if (jQuery('#_terp_id').val() == 'False') { |
674 | 205 | // we are opening an action on an unsaved record, | 206 | // we are opening an action on an unsaved record, |
675 | 206 | 207 | ||
676 | === modified file 'addons/openerp/static/javascript/web_keyboard_shortcuts.js' | |||
677 | --- addons/openerp/static/javascript/web_keyboard_shortcuts.js 2017-09-12 09:54:25 +0000 | |||
678 | +++ addons/openerp/static/javascript/web_keyboard_shortcuts.js 2017-10-27 15:15:39 +0000 | |||
679 | @@ -28,9 +28,107 @@ | |||
680 | 28 | 28 | ||
681 | 29 | $.ctrlshift = function(key, callback, args) { | 29 | $.ctrlshift = function(key, callback, args) { |
682 | 30 | $(document).keydown(function(e) { | 30 | $(document).keydown(function(e) { |
683 | 31 | if (e.ctrlKey && e.shiftKey) { | ||
684 | 32 | var class_to_parse = null | ||
685 | 33 | if (key == 'S'){ | ||
686 | 34 | class_to_parse = '.oe_form_button_save, .oe_form_button_save_line, .oe_form_button_save_close'; | ||
687 | 35 | } | ||
688 | 36 | else if (key == 'E'){ | ||
689 | 37 | class_to_parse = '.oe_form_button_save_edit, .oe_form_button_edit'; | ||
690 | 38 | } | ||
691 | 39 | else if (key == '46'){ | ||
692 | 40 | class_to_parse = '.oe_form_button_delete'; | ||
693 | 41 | } | ||
694 | 42 | else if (key == 'Z'){ | ||
695 | 43 | class_to_parse = '.oe_form_button_cancel'; | ||
696 | 44 | } | ||
697 | 45 | else if (key == 'C'){ | ||
698 | 46 | class_to_parse = '.oe_form_button_create, .oe_form_button_save_create'; | ||
699 | 47 | } | ||
700 | 48 | else if (key == 'D'){ | ||
701 | 49 | class_to_parse = '.oe_form_button_duplicate'; | ||
702 | 50 | } | ||
703 | 51 | else if (key == '13'){ | ||
704 | 52 | class_to_parse = '.oe_form_button_search'; | ||
705 | 53 | } | ||
706 | 54 | else if (key == '38'){ | ||
707 | 55 | class_to_parse = '.oe_button_pager[action="first"]'; | ||
708 | 56 | } | ||
709 | 57 | else if (key == '37'){ | ||
710 | 58 | class_to_parse = '.oe_button_pager[action="previous"]'; | ||
711 | 59 | } | ||
712 | 60 | else if (key == '39'){ | ||
713 | 61 | class_to_parse = '.oe_button_pager[action="next"]'; | ||
714 | 62 | } | ||
715 | 63 | else if (key == '40'){ | ||
716 | 64 | class_to_parse = '.oe_button_pager[action="last"]'; | ||
717 | 65 | } | ||
718 | 66 | if (class_to_parse != null){ | ||
719 | 67 | //$('.oe_form_button_save') | ||
720 | 68 | $(class_to_parse).each(function() { | ||
721 | 69 | |||
722 | 70 | // do not display tooltips on hidden notebook-page | ||
723 | 71 | if ($(this).closest('.notebook-page').length && !$(this).closest('.notebook-page-active').length){ | ||
724 | 72 | console.log('notebook page not active'); | ||
725 | 73 | |||
726 | 74 | } | ||
727 | 75 | else { | ||
728 | 76 | if (key == '46'){ | ||
729 | 77 | key_to_display = 'Del.' | ||
730 | 78 | } | ||
731 | 79 | else if (key == '13') { | ||
732 | 80 | key_to_display = 'Enter ↵' // Enter | ||
733 | 81 | //key_to_display = 'Enter' // Enter | ||
734 | 82 | } | ||
735 | 83 | else if (key == '38') { | ||
736 | 84 | key_to_display = '⇧' // UP | ||
737 | 85 | } | ||
738 | 86 | else if (key == '37') { | ||
739 | 87 | key_to_display = '⇦' // Left | ||
740 | 88 | } | ||
741 | 89 | else if (key == '39') { | ||
742 | 90 | key_to_display = '⇨' // Right | ||
743 | 91 | } | ||
744 | 92 | else if (key == '40') { | ||
745 | 93 | key_to_display = '⇩' // Down | ||
746 | 94 | } | ||
747 | 95 | else { | ||
748 | 96 | key_to_display = key | ||
749 | 97 | } | ||
750 | 98 | if ($(this).width() == 0) { | ||
751 | 99 | return false; | ||
752 | 100 | } | ||
753 | 101 | var $newdiv1 = $( "<span class='shortcut_tooltip'>" + key_to_display + "</span>" ); | ||
754 | 102 | $( "body" ).append($newdiv1); | ||
755 | 103 | var postion = $(this).position(); | ||
756 | 104 | var new_top = postion.top + 20; | ||
757 | 105 | if ($(this).width() <= 20){ | ||
758 | 106 | var new_left = postion.left - $newdiv1.width()/2; | ||
759 | 107 | } | ||
760 | 108 | else { | ||
761 | 109 | var new_left = postion.left + $(this).width()/2 - $newdiv1.width()/2 + 6; | ||
762 | 110 | } | ||
763 | 111 | $newdiv1.css({top: new_top, left: new_left, position:'absolute'}); | ||
764 | 112 | setTimeout(function() { | ||
765 | 113 | $newdiv1.css({'opacity': '0'}); | ||
766 | 114 | }, 1000); | ||
767 | 115 | |||
768 | 116 | setTimeout(function() { | ||
769 | 117 | $newdiv1.remove(); | ||
770 | 118 | }, 2000); | ||
771 | 119 | } | ||
772 | 120 | }); | ||
773 | 121 | } | ||
774 | 122 | } | ||
775 | 31 | if(!args) args=[]; // IE barks when args is null | 123 | if(!args) args=[]; // IE barks when args is null |
776 | 32 | if((e.keyCode == key.charCodeAt(0) || e.keyCode == key) && e.ctrlKey && e.shiftKey) { | 124 | if((e.keyCode == key.charCodeAt(0) || e.keyCode == key) && e.ctrlKey && e.shiftKey) { |
777 | 33 | e.preventDefault(); // override the browser shortcut keys | 125 | e.preventDefault(); // override the browser shortcut keys |
778 | 126 | if (!document.nb_shortcut_used){ | ||
779 | 127 | document.nb_shortcut_used = 1; | ||
780 | 128 | } | ||
781 | 129 | else{ | ||
782 | 130 | document.nb_shortcut_used += 1; | ||
783 | 131 | } | ||
784 | 34 | callback.apply(this, args); | 132 | callback.apply(this, args); |
785 | 35 | return false; | 133 | return false; |
786 | 36 | } | 134 | } |
787 | @@ -132,14 +230,14 @@ | |||
788 | 132 | }); | 230 | }); |
789 | 133 | }); | 231 | }); |
790 | 134 | 232 | ||
792 | 135 | //Previous object (arrow right) | 233 | //Previous object (arrow left) |
793 | 136 | $.ctrlshift('37', function() { | 234 | $.ctrlshift('37', function() { |
794 | 137 | $('.oe_button_pager[action="previous"]').each(function() { | 235 | $('.oe_button_pager[action="previous"]').each(function() { |
795 | 138 | fake_click(this); | 236 | fake_click(this); |
796 | 139 | }); | 237 | }); |
797 | 140 | }); | 238 | }); |
798 | 141 | 239 | ||
800 | 142 | //Next object (arrow left) | 240 | //Next object (arrow right) |
801 | 143 | $.ctrlshift('39', function() { | 241 | $.ctrlshift('39', function() { |
802 | 144 | $('.oe_button_pager[action="next"]').each(function() { | 242 | $('.oe_button_pager[action="next"]').each(function() { |
803 | 145 | fake_click(this); | 243 | fake_click(this); |