Merge lp:~openerp-dev/openobject-client-web/6.0-opw-18466-cpa into lp:openobject-client-web

Proposed by Chirag Patel (OpenERP) on 2011-10-31
Status: Merged
Approved by: Olivier Laurent (Open ERP) on 2011-11-21
Approved revision: 4725
Merge reported by: Olivier Laurent (Open ERP)
Merged at revision: not available
Proposed branch: lp:~openerp-dev/openobject-client-web/6.0-opw-18466-cpa
Merge into: lp:openobject-client-web
Diff against target: 24 lines (+0/-15)
1 file modified
addons/openerp/widgets/templates/viewform.mako (+0/-15)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client-web/6.0-opw-18466-cpa
Reviewer Review Type Date Requested Status
Vaibhav Darji (community) Approve on 2011-11-09
OpenERP Core Team 2011-10-31 Pending
Review via email: mp+80789@code.launchpad.net

Description of the change

Hello,

Default focus not work in search view.

Demo: Warehouse > Reporting > Moves Analysis

Observed: Focus on filter button YEAR.
Expected: Focus must be on Product(m2o in search view) field because we set <field name="product_id" default_focus="1"/> in view.

Thanks.

To post a comment you must log in.
Vaibhav Darji (vaibhav-openerp) wrote :

Seems to working fine.

review: Approve
Olivier Laurent (Open ERP) (olt) wrote :

I've checked your patch and it works as expected: 'Product' in search section field has the focus.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/widgets/templates/viewform.mako'
2--- addons/openerp/widgets/templates/viewform.mako 2011-01-17 14:11:42 +0000
3+++ addons/openerp/widgets/templates/viewform.mako 2011-10-31 11:09:34 +0000
4@@ -65,20 +65,5 @@
5 </tr>
6 </table>
7
8- <script type="text/javascript">
9-
10- jQuery(document).ready(function() {
11- % if screen.view_type == 'tree':
12- var filter_box_index = jQuery('#${name} div.filter-a').closest('td.item:first').index();
13- var input_index = jQuery('#${name} input[type!="hidden"][type="text"]:first').closest('td.label').index();
14- if(filter_box_index >= 0 && (filter_box_index < input_index)) {
15- jQuery('#${name} div.filter-a:first button').focus();
16- }
17- else {
18- jQuery('#${name} input[type!="hidden"][type="text"]:first').focus();
19- }
20- % endif
21- });
22- </script>
23 % endif
24 </form>