[FIX] web: required attribute on one2many field

Require One2many field without any line must show an error like many2many fields.

issue 11782
This commit is contained in:
Christophe Matthieu 2016-06-16 15:21:30 +02:00
parent 41ec7eec56
commit a9fac2ea2d
1 changed files with 3 additions and 0 deletions

View File

@ -4337,6 +4337,9 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({
commit_value: function() {
return this.save_any_view();
},
is_false: function () {
return _(this.dataset.ids).isEmpty();
},
save_any_view: function() {
var view = this.get_active_view();
if (view) {