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
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2013-01-07 16:18:07 +0000
+++ addons/web/static/src/js/view_form.js 2013-01-22 07:32:21 +0000
@@ -2476,6 +2476,10 @@
24762476
2477instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, {2477instance.web.form.FieldDatetime = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, {
2478 template: "FieldDatetime",2478 template: "FieldDatetime",
2479 init:function(){
2480 this._super.apply(this, arguments);
2481 this.in_picker = false;
2482 },
2479 build_widget: function() {2483 build_widget: function() {
2480 return new instance.web.DateTimeWidget(this);2484 return new instance.web.DateTimeWidget(this);
2481 },2485 },
@@ -2486,6 +2490,7 @@
2486 }2490 }
2487 },2491 },
2488 initialize_content: function() {2492 initialize_content: function() {
2493 var self = this;
2489 if (!this.get("effective_readonly")) {2494 if (!this.get("effective_readonly")) {
2490 this.datewidget = this.build_widget();2495 this.datewidget = this.build_widget();
2491 this.datewidget.on('datetime_changed', this, _.bind(function() {2496 this.datewidget.on('datetime_changed', this, _.bind(function() {
@@ -2493,6 +2498,12 @@
2493 }, this));2498 }, this));
2494 this.datewidget.appendTo(this.$el);2499 this.datewidget.appendTo(this.$el);
2495 this.setupFocus(this.datewidget.$input);2500 this.setupFocus(this.datewidget.$input);
2501 this.datewidget.picker('option', 'beforeShow', function () {
2502 self.in_picker = true;
2503 });
2504 this.datewidget.picker('option', 'onClose', function () {
2505 self.in_picker = false;
2506 });
2496 }2507 }
2497 },2508 },
2498 render_value: function() {2509 render_value: function() {
@@ -2502,6 +2513,12 @@
2502 this.$el.text(instance.web.format_value(this.get('value'), this, ''));2513 this.$el.text(instance.web.format_value(this.get('value'), this, ''));
2503 }2514 }
2504 },2515 },
2516 setupFocus:function($e){
2517 var self = this;
2518 var parent = this.getParent();
2519 $e.on({blur: function () {if(self.in_picker)parent.__clicked_inside = true;} });
2520 this._super($e);
2521 },
2505 is_syntax_valid: function() {2522 is_syntax_valid: function() {
2506 if (!this.get("effective_readonly") && this.datewidget) {2523 if (!this.get("effective_readonly") && this.datewidget) {
2507 return this.datewidget.is_valid_();2524 return this.datewidget.is_valid_();