[FIX] correctly check for o2m listview validity

if an edition has been canceled, don't check the form's content as it
does not matter.

lp bug: https://launchpad.net/bugs/1103507 fixed

bzr revid: xmo@openerp.com-20130312112244-zmt34jydpzge6yof
This commit is contained in:
Xavier Morel 2013-03-12 12:22:44 +01:00
parent 2dff34a18f
commit 3890039735
1 changed files with 6 additions and 2 deletions

View File

@ -3785,8 +3785,12 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
this.o2m.trigger_on_change();
},
is_valid: function () {
var form = this.editor.form;
var editor = this.editor;
var form = editor.form;
// If no edition is pending, the listview can not be invalid (?)
if (!editor.record) {
return true
}
// If the form has not been modified, the view can only be valid
// NB: is_dirty will also be set on defaults/onchanges/whatever?
// oe_form_dirty seems to only be set on actual user actions