Merge lp:~jfb-tempo-consulting/unifield-web/jfb-int into lp:unifield-web

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
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+332850@code.launchpad.net
To post a comment you must log in.
4872. By jftempo

US-2937 [IMP] JS code optimization

lp:~alexaubin/unifield-web/US-2937

4873. By jftempo

US-3589 [FIX] ir.ui.menu bug

lp:~alexaubin/unifield-web/US-3589-fix-ir-ui-menu

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

lp:~julie-w/unifield-web/US-2923

4875. By jftempo

US-3211 [FIX] Error message on field validation

lp:~alexaubin/unifield-web/US-3211

4876. By jftempo

US-3381 [IMP] New attribute auto_refresh on tree view to auto reload page

lp:~fabien-morin/unifield-web/fm-us-3381

4877. By jftempo

US-3172 [IMP] Keyboard shortcuts: popup help

lp:~fabien-morin/unifield-web/fm-us-3172

4878. By jftempo

US-2310 [FIX] Standard Import: keep context

lp:~julie-w/unifield-web/US-2310

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/openerp/controllers/__init__.py'
--- addons/openerp/controllers/__init__.py 2017-06-19 14:54:07 +0000
+++ addons/openerp/controllers/__init__.py 2017-10-27 15:15:39 +0000
@@ -16,6 +16,7 @@
16import selection16import selection
17import shortcuts17import shortcuts
18import banner18import banner
19import shortcut_tooltip
19import requests20import requests
20import unifield_version21import unifield_version
21import openm2o22import openm2o
2223
=== modified file 'addons/openerp/controllers/actions.py'
--- addons/openerp/controllers/actions.py 2017-05-16 12:26:11 +0000
+++ addons/openerp/controllers/actions.py 2017-10-27 15:15:39 +0000
@@ -65,7 +65,7 @@
65def execute_window(view_ids, model, res_id=False, domain=None, view_type='form', context=None,65def execute_window(view_ids, model, res_id=False, domain=None, view_type='form', context=None,
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,
67 context_menu=False, display_menu_tip=False, action_id=None,67 context_menu=False, display_menu_tip=False, action_id=None,
68 sidebar_open=False):68 sidebar_open=False, auto_refresh=False):
69 """Performs `actions.act_window` action.69 """Performs `actions.act_window` action.
7070
71 @param view_ids: view ids71 @param view_ids: view ids
@@ -93,6 +93,7 @@
93 params['display_menu_tip'] = display_menu_tip93 params['display_menu_tip'] = display_menu_tip
94 params['sidebar_open'] = sidebar_open94 params['sidebar_open'] = sidebar_open
95 params['target'] = target or None95 params['target'] = target or None
96 params['auto_refresh'] = auto_refresh
96 cherrypy.request._terp_view_name = name or None97 cherrypy.request._terp_view_name = name or None
97 cherrypy.request._terp_view_target = target or None98 cherrypy.request._terp_view_target = target or None
9899
@@ -367,7 +368,8 @@
367 context_menu=data.get('context_menu'),368 context_menu=data.get('context_menu'),
368 display_menu_tip=display_menu_tip,369 display_menu_tip=display_menu_tip,
369 action_id=action.get('id'),370 action_id=action.get('id'),
370 sidebar_open=action.get('sidebar_open'))371 sidebar_open=action.get('sidebar_open'),
372 auto_refresh=action.get('auto_refresh'))
371373
372def server(action, data):374def server(action, data):
373 context = dict(data.get('context', {}),375 context = dict(data.get('context', {}),
374376
=== modified file 'addons/openerp/controllers/form.py'
--- addons/openerp/controllers/form.py 2017-05-18 12:24:22 +0000
+++ addons/openerp/controllers/form.py 2017-10-27 15:15:39 +0000
@@ -273,7 +273,8 @@
273 tips = tips273 tips = tips
274274
275 is_dashboard = form.screen.is_dashboard or False275 is_dashboard = form.screen.is_dashboard or False
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
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)
277278
278 @expose('json', methods=('POST',))279 @expose('json', methods=('POST',))
279 def close_or_disable_tips(self):280 def close_or_disable_tips(self):
280281
=== modified file 'addons/openerp/controllers/impex.py'
--- addons/openerp/controllers/impex.py 2017-01-02 14:59:00 +0000
+++ addons/openerp/controllers/impex.py 2017-10-27 15:15:39 +0000
@@ -457,7 +457,7 @@
457 tree.show_headers = False457 tree.show_headers = False
458 return dict(error=error, records=records, success=success,458 return dict(error=error, records=records, success=success,
459 model=params.model, source=params.source,459 model=params.model, source=params.source,
460 tree=tree, fields=kw.get('fields', {}))460 tree=tree, fields=kw.get('fields', {}), ctx=ctx)
461461
462 @expose()462 @expose()
463 def detect_data(self, csvfile, csvsep, csvdel, csvcode, csvskip, **kw):463 def detect_data(self, csvfile, csvsep, csvdel, csvcode, csvskip, **kw):
@@ -566,7 +566,7 @@
566 **kw)566 **kw)
567567
568 datas = []568 datas = []
569 ctx = dict(rpc.session.context)569 ctx = dict((params.context or {}), **rpc.session.context)
570570
571 if not isinstance(fields, list):571 if not isinstance(fields, list):
572 fields = [fields]572 fields = [fields]
573573
=== modified file 'addons/openerp/controllers/search.py'
--- addons/openerp/controllers/search.py 2017-02-10 08:28:16 +0000
+++ addons/openerp/controllers/search.py 2017-10-27 15:15:39 +0000
@@ -398,8 +398,11 @@
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)
399399
400 # (US-1360) Get the original domain used, convert it from String to List, and store it in the context400 # (US-1360) Get the original domain used, convert it from String to List, and store it in the context
401 original_domain = all_domains.get('original_domain') and expr_eval(all_domains.get('original_domain')) or []401 if model != 'account.mcdb':
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
403 # would later be used on the account.analytic.lines/account.move.lines and lead to an inconsistent SQL request
404 original_domain = all_domains.get('original_domain') and expr_eval(all_domains.get('original_domain')) or []
405 ctx.update({'original_domain': original_domain})
403406
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))
405408
406409
=== added file 'addons/openerp/controllers/shortcut_tooltip.py'
--- addons/openerp/controllers/shortcut_tooltip.py 1970-01-01 00:00:00 +0000
+++ addons/openerp/controllers/shortcut_tooltip.py 2017-10-27 15:15:39 +0000
@@ -0,0 +1,33 @@
1###############################################################################
2#
3# Copyright (C) 2007-TODAY OpenERP SA. All Rights Reserved.
4#
5# $Id$
6#
7# Developed by OpenERP (http://openerp.com) and Axelor (http://axelor.com).
8#
9# The OpenERP web client is distributed under the "OpenERP Public License".
10# It's based on Mozilla Public License Version (MPL) 1.1 with following
11# restrictions:
12#
13# - All names, links and logos of OpenERP must be kept as in original
14# distribution without any changes in all software screens, especially
15# in start-up page and the software header, even if the application
16# source code has been changed or updated or code has been added.
17#
18# You can see the MPL licence at: http://www.mozilla.org/MPL/MPL-1.1.html
19#
20###############################################################################
21from openerp.controllers import SecuredController
22from openerp.utils import rpc
23
24
25class ShortcutTooltip(SecuredController):
26
27 _cp_path = "/openerp/shortcut_tooltip"
28
29 def get_show_shortcut(self):
30 proxy = rpc.RPCProxy('sync.client.entity')
31 return proxy.display_shortcut_message()
32
33# vim: ts=4 sts=4 sw=4 si et
034
=== modified file 'addons/openerp/controllers/templates/base.mako'
--- addons/openerp/controllers/templates/base.mako 2017-09-14 13:33:18 +0000
+++ addons/openerp/controllers/templates/base.mako 2017-10-27 15:15:39 +0000
@@ -1,31 +1,31 @@
1<%inherit file="/openobject/controllers/templates/base.mako"/>1<%inherit file="/openobject/controllers/templates/base.mako"/>
22
3<%def name="header()">3<%def name="header()">
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>
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>
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>
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>
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>
99
10 <script type="text/javascript" src="/openerp/static/javascript/scripts.js"></script>10 <script type="text/javascript" src="/openerp/static/javascript/scripts.js"></script>
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>
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>
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>
1414
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>
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>
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>
18 <script type="text/javascript" src="/openerp/static/javascript/binary.js"></script>18 <script type="text/javascript" src="/openerp/static/javascript/binary.js"></script>
19 <script type="text/javascript" src="/openerp/static/jscal/calendar.js"></script>19 <script type="text/javascript" src="/openerp/static/jscal/calendar.js"></script>
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>
2121
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>
2323
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"/>
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"/>
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"/>
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"/>
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"/>
2929
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"/>
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"/>
3232
=== modified file 'addons/openerp/controllers/templates/exp.mako'
--- addons/openerp/controllers/templates/exp.mako 2017-08-29 09:33:08 +0000
+++ addons/openerp/controllers/templates/exp.mako 2017-10-27 15:15:39 +0000
@@ -286,7 +286,7 @@
286 <table width="100%">286 <table width="100%">
287 <tr>287 <tr>
288 <td class="imp-header" align="right">288 <td class="imp-header" align="right">
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>
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>
291 </td>291 </td>
292 <td width="5%"></td>292 <td width="5%"></td>
293293
=== modified file 'addons/openerp/controllers/templates/form.mako'
--- addons/openerp/controllers/templates/form.mako 2017-06-01 13:48:36 +0000
+++ addons/openerp/controllers/templates/form.mako 2017-10-27 15:15:39 +0000
@@ -25,6 +25,15 @@
25 /*25 /*
26 % endif26 % endif
27 */27 */
28 /*
29 % if auto_refresh :
30 */
31 setTimeout(function() {
32 location.reload();
33 }, ${auto_refresh}*1000);
34 /*
35 % endif
36 */
28 setTimeout(function() {37 setTimeout(function() {
29 jQuery('[autofocus="autofocus"]').focus();38 jQuery('[autofocus="autofocus"]').focus();
30 }, 10);39 }, 10);
@@ -95,10 +104,10 @@
95 % endif104 % endif
96105
97 % if obj_process:106 % if obj_process:
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)}"
99 title="${_('Corporate Intelligence...')}">108 title="${_('Corporate Intelligence...')}">
100 <small>Help</small>109 <small>Help</small>
101 </a>110 </a>
102 % endif111 % endif
103 % if form.screen.view_type == 'form' and form.logs.logs:112 % if form.screen.view_type == 'form' and form.logs.logs:
104 <a id="show_server_logs" class="logs" href="javascript: void(0)"113 <a id="show_server_logs" class="logs" href="javascript: void(0)"
@@ -166,6 +175,7 @@
166 % if buttons.pager:175 % if buttons.pager:
167 ${pager.display()}176 ${pager.display()}
168 % endif177 % endif
178
169 </div>179 </div>
170 % endif180 % endif
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>
@@ -209,6 +219,10 @@
209 $hide.click();219 $hide.click();
210 return false;220 return false;
211 })221 })
222
223 % if tg_errors:
224 error_display(_("The form contains errors."));
225 % endif
212 })226 })
213 </script>227 </script>
214</%def>228</%def>
215229
=== modified file 'addons/openerp/controllers/templates/header.mako'
--- addons/openerp/controllers/templates/header.mako 2016-06-14 16:01:53 +0000
+++ addons/openerp/controllers/templates/header.mako 2017-10-27 15:15:39 +0000
@@ -4,7 +4,6 @@
4 ROOT = cp.request.pool.get_controller("/openerp")4 ROOT = cp.request.pool.get_controller("/openerp")
5 SHORTCUTS = cp.request.pool.get_controller("/openerp/shortcuts")5 SHORTCUTS = cp.request.pool.get_controller("/openerp/shortcuts")
6 REQUESTS = cp.request.pool.get_controller("/openerp/requests")6 REQUESTS = cp.request.pool.get_controller("/openerp/requests")
7 UF_VERSION = cp.request.pool.get_controller("/openerp/unifield_version")
87
9 shortcuts = SHORTCUTS.my()8 shortcuts = SHORTCUTS.my()
10 requests, total_request = REQUESTS.my()9 requests, total_request = REQUESTS.my()
@@ -30,9 +29,6 @@
30add_style = cp.config('server.environment') in css_style_dict.keys()29add_style = cp.config('server.environment') in css_style_dict.keys()
31if add_style:30if add_style:
32 css_style = css_style_dict.get(cp.config('server.environment'), "")31 css_style = css_style_dict.get(cp.config('server.environment'), "")
33
34from openobject import release
35version = release.version
36%>32%>
37<td id="top"33<td id="top"
38 % if add_style:34 % if add_style:
@@ -153,6 +149,6 @@
153 src:this.href149 src:this.href
154 }, null, {150 }, null, {
155 height: 350151 height: 350
156 });152 }).focus();
157 });153 });
158</script>154</script>
159155
=== modified file 'addons/openerp/controllers/templates/imp.mako'
--- addons/openerp/controllers/templates/imp.mako 2015-10-23 08:08:51 +0000
+++ addons/openerp/controllers/templates/imp.mako 2017-10-27 15:15:39 +0000
@@ -71,6 +71,7 @@
71 <input type="hidden" id="_terp_model" name="_terp_model" value="${model}"/>71 <input type="hidden" id="_terp_model" name="_terp_model" value="${model}"/>
72 <input type="hidden" id="_terp_ids" name="_terp_ids" value="[]"/>72 <input type="hidden" id="_terp_ids" name="_terp_ids" value="[]"/>
73 <input type="hidden" id="_terp_fields2" name="_terp_fields2" value="[]"/>73 <input type="hidden" id="_terp_fields2" name="_terp_fields2" value="[]"/>
74 <input type="hidden" id="_terp_context" name="_terp_context" value="${ctx}"/>
7475
75 <table class="view" cellspacing="5" border="0" width="100%">76 <table class="view" cellspacing="5" border="0" width="100%">
76 <tr>77 <tr>
@@ -202,7 +203,7 @@
202 <table width="100%">203 <table width="100%">
203 <tr>204 <tr>
204 <td class="imp-header" align="left">205 <td class="imp-header" align="left">
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>
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>
207 </td>208 </td>
208 <td width="5%"></td>209 <td width="5%"></td>
209210
=== modified file 'addons/openerp/controllers/templates/index.mako'
--- addons/openerp/controllers/templates/index.mako 2017-06-19 14:54:07 +0000
+++ addons/openerp/controllers/templates/index.mako 2017-10-27 15:15:39 +0000
@@ -94,6 +94,9 @@
94 <tr>94 <tr>
95 <%include file="banner.mako"/>95 <%include file="banner.mako"/>
96 </tr>96 </tr>
97 <tr>
98 <%include file="shortcut_tooltip.mako"/>
99 </tr>
97 % if tools is not None:100 % if tools is not None:
98 <tr>101 <tr>
99 <td id="secondary" class="sidenav-open">102 <td id="secondary" class="sidenav-open">
100103
=== modified file 'addons/openerp/controllers/templates/preferences/index.mako'
--- addons/openerp/controllers/templates/preferences/index.mako 2016-11-21 09:45:23 +0000
+++ addons/openerp/controllers/templates/preferences/index.mako 2017-10-27 15:15:39 +0000
@@ -35,7 +35,7 @@
35 <button type='button' class="static_boxes"35 <button type='button' class="static_boxes"
36 onclick="open_password(); return false;"36 onclick="open_password(); return false;"
37 >${_("Change Password")}</button>37 >${_("Change Password")}</button>
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>
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>
40 </td>40 </td>
41 </tr>41 </tr>
4242
=== added file 'addons/openerp/controllers/templates/shortcut_tooltip.mako'
--- addons/openerp/controllers/templates/shortcut_tooltip.mako 1970-01-01 00:00:00 +0000
+++ addons/openerp/controllers/templates/shortcut_tooltip.mako 2017-10-27 15:15:39 +0000
@@ -0,0 +1,13 @@
1<%
2# put in try block to prevent improper redirection on connection refuse error
3try:
4 SHORTCUT = cp.request.pool.get_controller("/openerp/shortcut_tooltip")
5 display_message = SHORTCUT.get_show_shortcut()
6 message = _("You haven't recently used a keyboard shortcut. You can see what shortcuts are available on this screen by holding SHIFT + CTRL.")
7except:
8 display_message = False
9 message = 'toto'
10%>
11% if display_message:
12<td id="shortcut_message" colspan="3">${message | h}</td>
13% endif
014
=== modified file 'addons/openerp/po/javascript/fr.po'
--- addons/openerp/po/javascript/fr.po 2017-02-06 11:21:15 +0000
+++ addons/openerp/po/javascript/fr.po 2017-10-27 15:15:39 +0000
@@ -114,3 +114,7 @@
114#: static/javascript/form.js114#: static/javascript/form.js
115msgid "You cannot upload files bigger than %(max_size)sMB, current size is %(size)sMB"115msgid "You cannot upload files bigger than %(max_size)sMB, current size is %(size)sMB"
116msgstr "Vous ne pouvez pas envoyer des fichiers plus gros que %(max_size)sMB, la taille actuelle est de %(size)sMB"116msgstr "Vous ne pouvez pas envoyer des fichiers plus gros que %(max_size)sMB, la taille actuelle est de %(size)sMB"
117
118#: addons/openerp/controllers/templates/form.mako
119msgid "The form contains errors."
120msgstr "Le formulaire comporte des erreurs."
117121
=== modified file 'addons/openerp/po/messages/fr.po'
--- addons/openerp/po/messages/fr.po 2017-01-02 14:59:00 +0000
+++ addons/openerp/po/messages/fr.po 2017-10-27 15:15:39 +0000
@@ -1775,3 +1775,7 @@
1775#~ msgid "Click here to add new image."1775#~ msgid "Click here to add new image."
1776#~ msgstr "Cliquez ici pour ajouter une nouvelle image"1776#~ msgstr "Cliquez ici pour ajouter une nouvelle image"
17771777
1778#: controllers/templates/shortcut_tooltip.mako:6
1779#, python-format
1780msgid "You haven't recently used a keyboard shortcut. You can see what shortcuts are available on this screen by holding SHIFT + CTRL."
1781msgstr "Vous n'avez pas utilisé de raccourci clavier récemment. Vous pouvez voir quels raccourcis sont disponibles sur cet écran en utilisant CTRL + SHIFT."
17781782
=== modified file 'addons/openerp/static/css/screen.css'
--- addons/openerp/static/css/screen.css 2017-07-10 08:56:45 +0000
+++ addons/openerp/static/css/screen.css 2017-10-27 15:15:39 +0000
@@ -2378,3 +2378,13 @@
2378 background: rgba(255, 165, 0, .6);2378 background: rgba(255, 165, 0, .6);
2379 white-space: pre-line;2379 white-space: pre-line;
2380}2380}
2381
2382#shortcut_message {
2383 font-weight: bold;
2384 font-size: 1.2em;
2385 height: 2em;
2386 text-align: center;
2387 background: rgb(184, 222, 130);
2388 background: rgba(184, 222, 130, .6);
2389 white-space: pre-line;
2390}
23812391
=== modified file 'addons/openerp/static/css/tips.css'
--- addons/openerp/static/css/tips.css 2010-11-23 10:11:52 +0000
+++ addons/openerp/static/css/tips.css 2017-10-27 15:15:39 +0000
@@ -39,3 +39,22 @@
39 font-size: 12px;39 font-size: 12px;
40}40}
4141
42
43.shortcut_tooltip {
44 padding: 4px;
45 text-align: center;
46 font-family: sans-serif;
47 font-size: 11px;
48 color: #666666;
49 z-index: 1000;
50 border-radius: 6px;
51 -moz-border-radius: 6px;
52 -webkit-border-radius: 6px;
53 background: #FCF9A7;
54 border: 1px solid #999;
55 max-width: 500px;
56 opacity: 1;
57 -webkit-transition: opacity 1000ms linear;
58 transition: opacity 1000ms linear;
59 font-weight: bold;
60}
4261
=== modified file 'addons/openerp/static/javascript/form.js'
--- addons/openerp/static/javascript/form.js 2017-10-20 13:34:27 +0000
+++ addons/openerp/static/javascript/form.js 2017-10-27 15:15:39 +0000
@@ -97,6 +97,27 @@
9797
98 var prefix = src && src != '_terp_list' ? src + '/' : '';98 var prefix = src && src != '_terp_list' ? src + '/' : '';
9999
100 // Here we do a sanity check that there aren't multiple element with
101 // the same id 'prefix/_terp_model'
102 // If this is the case, we introduce some delay (call back the same
103 // function later)
104 //
105 // This can happen in some asynchronous edge-case where the DOM is not
106 // fully loaded yet and in particular there's a remaining element with
107 // _terp_model = ir.ui.menu
108 // which might trigger the opening of a completely unrealted view
109 //
110 // You might reproduce the issue by monitoring the value of
111 // openobject.dom.get(prefix + '_terp_model').value
112 // when loading for instance the list of Commitment Vouchers
113 //
114 // See https://jira.unifield.org/browse/US-3589
115 //
116 if ($("[id="+prefix+"_terp_model]").length > 1) {
117 callLater(0.1, openRecord, id, src, target, readonly);
118 return;
119 }
120
100 var args = {121 var args = {
101 'model': openobject.dom.get(prefix + '_terp_model').value,122 'model': openobject.dom.get(prefix + '_terp_model').value,
102 'id': id || 'False',123 'id': id || 'False',
@@ -255,11 +276,11 @@
255}276}
256277
257278
258function error_display(msg) {279function error_display(msg, title='Warning Message') {
259 var error = jQuery("<table>",{'width': '100%', 'height': '100%'}280 var error = jQuery("<table>",{'width': '100%', 'height': '100%'}
260 ).append(281 ).append(
261 jQuery("<tr>").append(282 jQuery("<tr>").append(
262 jQuery("<td>", {'colspan': 2, 'class': 'error_message_header'}).text(_('Warning Message'))283 jQuery("<td>", {'colspan': 2, 'class': 'error_message_header'}).text(_(title))
263 ),284 ),
264 jQuery("<tr>").append(285 jQuery("<tr>").append(
265 jQuery("<td>", {'css': 'padding: 4px 2px;'}).append(286 jQuery("<td>", {'css': 'padding: 4px 2px;'}).append(
@@ -275,7 +296,13 @@
275 .text('OK')296 .text('OK')
276 )297 )
277 ));298 ));
278 window.top.jQuery.fancybox(error, {scrolling: 'no'});299 error.find('.button-a').focus()
300 window.top.jQuery.fancybox(error, {
301 scrolling: 'no',
302 onComplete: function () {
303 $(this).find(".button-a").focus()
304 }
305 });
279}306}
280307
281function get_sidebar_status(args, noterp) {308function get_sidebar_status(args, noterp) {
@@ -1022,7 +1049,18 @@
1022 }1049 }
10231050
1024 if (obj.error) {1051 if (obj.error) {
1025 return error_popup(obj.error)1052 // 'TinyForm' error case : obj.error is a string
1053 if (obj.error_field) {
1054 // Retrieve the label associated to the label and display the
1055 // error
1056 var error_field_label = $('label[for="'+obj.error_field+'"]').text().trim()
1057 return error_display(error_field_label+" : "+obj.error);
1058 }
1059 // General exception case (no obj.error_field given)
1060 // obj.error is a full HTML page (and error_popup will display it)
1061 else {
1062 return error_popup(obj);
1063 }
1026 }1064 }
10271065
1028 return obj;1066 return obj;
@@ -1404,9 +1442,8 @@
1404 dataType: 'json',1442 dataType: 'json',
1405 success: function(obj) {1443 success: function(obj) {
1406 if(obj.error) {1444 if(obj.error) {
1407 error_popup(obj.error);1445 error_display(obj.error);
1408 }1446 }
1409
1410 $attachment_line.remove();1447 $attachment_line.remove();
1411 }1448 }
1412 });1449 });
14131450
=== modified file 'addons/openerp/static/javascript/form_state.js'
--- addons/openerp/static/javascript/form_state.js 2017-10-19 14:33:30 +0000
+++ addons/openerp/static/javascript/form_state.js 2017-10-27 15:15:39 +0000
@@ -190,11 +190,19 @@
190}190}
191191
192function list_hookAttrChange(list_name) {192function list_hookAttrChange(list_name) {
193 jQuery('table[id='+list_name+'_grid] [attrs]').each(function () {193
194 var $this = jQuery(this);194 // check if an editor exists
195 var editor_exists = $(".editors").length;
196
197 // Loop on list elements which have an 'attrs' attribute
198 var listgrids = jQuery('table[id='+list_name+'_grid] [attrs]');
199 for (var i = 0 ; i < listgrids.length ; i++)
200 {
201 var elem = listgrids[i];
202 var $this = jQuery(elem);
195 var attrs = $this.attr('attrs') || '{}';203 var attrs = $this.attr('attrs') || '{}';
196 var widget = $this.attr('widget') || '';204 var widget = $this.attr('widget') || '';
197 var container = this;205 var container = elem;
198 var prefix = widget.slice(0, widget.lastIndexOf('/')+1) || '';206 var prefix = widget.slice(0, widget.lastIndexOf('/')+1) || '';
199207
200 // Convert Python statement into it's equivalent in JavaScript.208 // Convert Python statement into it's equivalent in JavaScript.
@@ -207,11 +215,9 @@
207 try {215 try {
208 attrs = eval('(' + attrs + ')');216 attrs = eval('(' + attrs + ')');
209 } catch(e){217 } catch(e){
210 return;218 continue;
211 }219 }
212220
213 // check if an editor exists
214 var editor_exists = $(".editors").length;
215 var cache_values = {};221 var cache_values = {};
216222
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');
@@ -225,6 +231,7 @@
225 return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values);231 return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values);
226 }232 }
227 forEach(attrs[attr], function(n) {233 forEach(attrs[attr], function(n) {
234
228 if (typeof(n) == "number") { // {'invisible': [1]}235 if (typeof(n) == "number") { // {'invisible': [1]}
229 return form_onAttrChange(container, widget, attr, n, $this, cache_values);236 return form_onAttrChange(container, widget, attr, n, $this, cache_values);
230 }237 }
@@ -237,7 +244,7 @@
237 return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values);244 return form_onAttrChange(container, widget, attr, attrs[attr], $this, cache_values);
238 });245 });
239 }246 }
240 });247 };
241}248}
242249
243function form_onAttrChange(container, widgetName, attr, expr, elem, cache_values) {250function form_onAttrChange(container, widgetName, attr, expr, elem, cache_values) {
244251
=== modified file 'addons/openerp/static/javascript/listgrid.js'
--- addons/openerp/static/javascript/listgrid.js 2017-10-16 09:48:57 +0000
+++ addons/openerp/static/javascript/listgrid.js 2017-10-27 15:15:39 +0000
@@ -1155,7 +1155,7 @@
1155 }, null, {1155 }, null, {
1156 height: '98%',1156 height: '98%',
1157 max_height: 6001157 max_height: 600
1158 });1158 }).focus();
1159 },1159 },
11601160
1161 importData: function() {1161 importData: function() {
@@ -1169,7 +1169,7 @@
1169 height: '98%',1169 height: '98%',
1170 max_height: 550,1170 max_height: 550,
1171 width: '95%'1171 width: '95%'
1172 });1172 }).focus();
1173 }1173 }
1174});1174});
11751175
11761176
=== modified file 'addons/openerp/static/javascript/m2m.js'
--- addons/openerp/static/javascript/m2m.js 2017-01-02 14:59:00 +0000
+++ addons/openerp/static/javascript/m2m.js 2017-10-27 15:15:39 +0000
@@ -190,7 +190,7 @@
190 } else {190 } else {
191 url = '/openerp/search/new';191 url = '/openerp/search/new';
192 }192 }
193 return $.frame_dialog({193 var $frame = $.frame_dialog({
194 src: openobject.http.getURL(url, options)194 src: openobject.http.getURL(url, options)
195 }, {195 }, {
196 'source-window': $this[0],196 'source-window': $this[0],
@@ -199,6 +199,8 @@
199 width: '90%',199 width: '90%',
200 height: '95%'200 height: '95%'
201 });201 });
202 $frame.focus();
203 return $frame;
202 }204 }
203205
204 /**206 /**
205207
=== modified file 'addons/openerp/static/javascript/m2o.js'
--- addons/openerp/static/javascript/m2o.js 2017-06-01 13:48:36 +0000
+++ addons/openerp/static/javascript/m2o.js 2017-10-27 15:15:39 +0000
@@ -606,7 +606,7 @@
606 } else {606 } else {
607 url = '/openerp/search/new';607 url = '/openerp/search/new';
608 }608 }
609 return $.frame_dialog({609 var $frame = $.frame_dialog({
610 src: openobject.http.getURL(url, options)610 src: openobject.http.getURL(url, options)
611 }, {611 }, {
612 'source-window': $this[0],612 'source-window': $this[0],
@@ -616,6 +616,8 @@
616 max_width: 1200,616 max_width: 1200,
617 height: '95%'617 height: '95%'
618 });618 });
619 $frame.focus();
620 return $frame;
619 }621 }
620622
621 /**623 /**
@@ -681,7 +683,7 @@
681 if(arguments[0] === "close") {683 if(arguments[0] === "close") {
682 return close($this, arguments[1]);684 return close($this, arguments[1]);
683 } else {685 } else {
684 return open($this, arguments[0]);686 return open($this, arguments[0]).focus();
685 }687 }
686 };688 };
687})(jQuery);689})(jQuery);
688690
=== modified file 'addons/openerp/static/javascript/o2m.js'
--- addons/openerp/static/javascript/o2m.js 2017-10-20 13:34:27 +0000
+++ addons/openerp/static/javascript/o2m.js 2017-10-27 15:15:39 +0000
@@ -260,7 +260,13 @@
260 });260 });
261 $frame.load(function() {261 $frame.load(function() {
262 $frame_content = $frame.contents();262 $frame_content = $frame.contents();
263 $frame_content.find("[autofocus='autofocus']").focus();263 if ($frame_content.find("[autofocus='autofocus']").lenght) {
264 // if a field have an autofocus attribute, set the focus on it
265 $frame_content.find("[autofocus='autofocus']").focus();
266 }
267 else {
268 $frame.focus(); // set the focus on the whole frame
269 }
264 });270 });
265 var $form = jQuery('<form>', {271 var $form = jQuery('<form>', {
266 method: 'POST',272 method: 'POST',
267273
=== modified file 'addons/openerp/static/javascript/openerp/openerp.base.js'
--- addons/openerp/static/javascript/openerp/openerp.base.js 2017-10-17 09:38:02 +0000
+++ addons/openerp/static/javascript/openerp/openerp.base.js 2017-10-27 15:15:39 +0000
@@ -193,13 +193,14 @@
193 var $dialogs = jQuery('.action-dialog');193 var $dialogs = jQuery('.action-dialog');
194 switch(target) {194 switch(target) {
195 case 'new':195 case 'new':
196 jQuery.frame_dialog({196 $frame = jQuery.frame_dialog({
197 src: action_url,197 src: action_url,
198 'class': 'action-dialog'198 'class': 'action-dialog'
199 }, null, {199 }, null, {
200 width: '90%',200 width: '90%',
201 height: '95%'201 height: '95%'
202 });202 });
203 $frame.focus();
203 if (terp_id && !$dialogs.length) {204 if (terp_id && !$dialogs.length) {
204 if (jQuery('#_terp_id').val() == 'False') {205 if (jQuery('#_terp_id').val() == 'False') {
205 // we are opening an action on an unsaved record,206 // we are opening an action on an unsaved record,
206207
=== modified file 'addons/openerp/static/javascript/web_keyboard_shortcuts.js'
--- addons/openerp/static/javascript/web_keyboard_shortcuts.js 2017-09-12 09:54:25 +0000
+++ addons/openerp/static/javascript/web_keyboard_shortcuts.js 2017-10-27 15:15:39 +0000
@@ -28,9 +28,107 @@
2828
29$.ctrlshift = function(key, callback, args) {29$.ctrlshift = function(key, callback, args) {
30 $(document).keydown(function(e) {30 $(document).keydown(function(e) {
31 if (e.ctrlKey && e.shiftKey) {
32 var class_to_parse = null
33 if (key == 'S'){
34 class_to_parse = '.oe_form_button_save, .oe_form_button_save_line, .oe_form_button_save_close';
35 }
36 else if (key == 'E'){
37 class_to_parse = '.oe_form_button_save_edit, .oe_form_button_edit';
38 }
39 else if (key == '46'){
40 class_to_parse = '.oe_form_button_delete';
41 }
42 else if (key == 'Z'){
43 class_to_parse = '.oe_form_button_cancel';
44 }
45 else if (key == 'C'){
46 class_to_parse = '.oe_form_button_create, .oe_form_button_save_create';
47 }
48 else if (key == 'D'){
49 class_to_parse = '.oe_form_button_duplicate';
50 }
51 else if (key == '13'){
52 class_to_parse = '.oe_form_button_search';
53 }
54 else if (key == '38'){
55 class_to_parse = '.oe_button_pager[action="first"]';
56 }
57 else if (key == '37'){
58 class_to_parse = '.oe_button_pager[action="previous"]';
59 }
60 else if (key == '39'){
61 class_to_parse = '.oe_button_pager[action="next"]';
62 }
63 else if (key == '40'){
64 class_to_parse = '.oe_button_pager[action="last"]';
65 }
66 if (class_to_parse != null){
67 //$('.oe_form_button_save')
68 $(class_to_parse).each(function() {
69
70 // do not display tooltips on hidden notebook-page
71 if ($(this).closest('.notebook-page').length && !$(this).closest('.notebook-page-active').length){
72 console.log('notebook page not active');
73
74 }
75 else {
76 if (key == '46'){
77 key_to_display = 'Del.'
78 }
79 else if (key == '13') {
80 key_to_display = 'Enter&nbsp;&#8629;' // Enter
81 //key_to_display = 'Enter' // Enter
82 }
83 else if (key == '38') {
84 key_to_display = '&#8679;' // UP
85 }
86 else if (key == '37') {
87 key_to_display = '&#8678;' // Left
88 }
89 else if (key == '39') {
90 key_to_display = '&#8680;' // Right
91 }
92 else if (key == '40') {
93 key_to_display = '&#8681;' // Down
94 }
95 else {
96 key_to_display = key
97 }
98 if ($(this).width() == 0) {
99 return false;
100 }
101 var $newdiv1 = $( "<span class='shortcut_tooltip'>" + key_to_display + "</span>" );
102 $( "body" ).append($newdiv1);
103 var postion = $(this).position();
104 var new_top = postion.top + 20;
105 if ($(this).width() <= 20){
106 var new_left = postion.left - $newdiv1.width()/2;
107 }
108 else {
109 var new_left = postion.left + $(this).width()/2 - $newdiv1.width()/2 + 6;
110 }
111 $newdiv1.css({top: new_top, left: new_left, position:'absolute'});
112 setTimeout(function() {
113 $newdiv1.css({'opacity': '0'});
114 }, 1000);
115
116 setTimeout(function() {
117 $newdiv1.remove();
118 }, 2000);
119 }
120 });
121 }
122 }
31 if(!args) args=[]; // IE barks when args is null123 if(!args) args=[]; // IE barks when args is null
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) {
33 e.preventDefault(); // override the browser shortcut keys125 e.preventDefault(); // override the browser shortcut keys
126 if (!document.nb_shortcut_used){
127 document.nb_shortcut_used = 1;
128 }
129 else{
130 document.nb_shortcut_used += 1;
131 }
34 callback.apply(this, args);132 callback.apply(this, args);
35 return false;133 return false;
36 }134 }
@@ -132,14 +230,14 @@
132 });230 });
133});231});
134232
135//Previous object (arrow right)233//Previous object (arrow left)
136$.ctrlshift('37', function() {234$.ctrlshift('37', function() {
137 $('.oe_button_pager[action="previous"]').each(function() {235 $('.oe_button_pager[action="previous"]').each(function() {
138 fake_click(this);236 fake_click(this);
139 });237 });
140});238});
141239
142//Next object (arrow left)240//Next object (arrow right)
143$.ctrlshift('39', function() {241$.ctrlshift('39', function() {
144 $('.oe_button_pager[action="next"]').each(function() {242 $('.oe_button_pager[action="next"]').each(function() {
145 fake_click(this);243 fake_click(this);

Subscribers

People subscribed via source and target branches