Merge lp:~openerp-dev/openerp-web/7.0-opw-579519-port-vme into lp:openerp-web/7.0

Proposed by Vidhin Mehta (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/7.0-opw-579519-port-vme
Merge into: lp:openerp-web/7.0
Diff against target: 48 lines (+17/-0)
1 file modified
addons/web/static/src/js/view_form.js (+17/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/7.0-opw-579519-port-vme
Reviewer Review Type Date Requested Status
Christophe Matthieu (OpenERP) (community) Needs Information
Review via email: mp+144234@code.launchpad.net

Description of the change

In FieldDatetime widget when try to work with *datetimepicker of jquery* it calls blur of FieldDatetime and editable list view try to save form.

To Reproduce :https://docs.google.com/open?id=0By4GWTWr6HDNaEs2YWl2TnhSSkU

To post a comment you must log in.
Revision history for this message
Christophe Matthieu (OpenERP) (chm-openerp) wrote :

Hi,
I test with chrome : "My Current Timesheet" => "Details" => "Add an item". I don't see this bug in 7.0 or in trunk.

review: Needs Information
Revision history for this message
Vidhin Mehta (OpenERP) (vme-openerp) wrote :

Hi,
    I can still reproduce this bug in both FF and Chrome.
    Please check video :https://docs.google.com/open?id=0By4GWTWr6HDNaEs2YWl2TnhSSkU.

Unmerged revisions

3709. By Vidhin Mehta (OpenERP)

[FIX]datetime widget calls blur on one2many listview widget.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2013-01-07 16:18:07 +0000
3+++ addons/web/static/src/js/view_form.js 2013-01-22 07:32:21 +0000
4@@ -2476,6 +2476,10 @@
5
6 instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, {
7 template: "FieldDatetime",
8+ init:function(){
9+ this._super.apply(this, arguments);
10+ this.in_picker = false;
11+ },
12 build_widget: function() {
13 return new instance.web.DateTimeWidget(this);
14 },
15@@ -2486,6 +2490,7 @@
16 }
17 },
18 initialize_content: function() {
19+ var self = this;
20 if (!this.get("effective_readonly")) {
21 this.datewidget = this.build_widget();
22 this.datewidget.on('datetime_changed', this, _.bind(function() {
23@@ -2493,6 +2498,12 @@
24 }, this));
25 this.datewidget.appendTo(this.$el);
26 this.setupFocus(this.datewidget.$input);
27+ this.datewidget.picker('option', 'beforeShow', function () {
28+ self.in_picker = true;
29+ });
30+ this.datewidget.picker('option', 'onClose', function () {
31+ self.in_picker = false;
32+ });
33 }
34 },
35 render_value: function() {
36@@ -2502,6 +2513,12 @@
37 this.$el.text(instance.web.format_value(this.get('value'), this, ''));
38 }
39 },
40+ setupFocus:function($e){
41+ var self = this;
42+ var parent = this.getParent();
43+ $e.on({blur: function () {if(self.in_picker)parent.__clicked_inside = true;} });
44+ this._super($e);
45+ },
46 is_syntax_valid: function() {
47 if (!this.get("effective_readonly") && this.datewidget) {
48 return this.datewidget.is_valid_();