[FIX] if a form is not dirty, always consider the corresponding o2m[list] to be valid

the user has not modified the editable line after opening it (whether to create a new record or to edit an existing one), so shouldn't be invalid

bzr revid: xmo@openerp.com-20120613153555-fq0moy1q464l92yj
This commit is contained in:
Xavier Morel 2012-06-13 17:35:55 +02:00
parent e475bc7a2a
commit 533f17231c
1 changed files with 6 additions and 0 deletions

View File

@ -2561,6 +2561,12 @@ openerp.web.form.One2ManyListView = openerp.web.ListView.extend({
if (!(form = this.first_edition_form())) {
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
if (!form.$element.is('.oe_form_dirty')) {
return true;
}
// Otherwise validate internal form
return _(form.fields).chain()