[FIX] web: on_change event on one2many fields was not fired if an attribute is mandatory (courtesy of Christophe Matthieu)
opw: 626974
This commit is contained in:
parent
209ce6f48c
commit
2cc09e86af
|
@ -3873,8 +3873,8 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
||||||
|
|
||||||
this.records
|
this.records
|
||||||
.bind('add', this.proxy("changed_records"))
|
.bind('add', this.proxy("changed_records"))
|
||||||
.bind('edit', this.proxy("changed_records"))
|
|
||||||
.bind('remove', this.proxy("changed_records"));
|
.bind('remove', this.proxy("changed_records"));
|
||||||
|
this.on('save:after', this, this.proxy("changed_records"));
|
||||||
},
|
},
|
||||||
start: function () {
|
start: function () {
|
||||||
var ret = this._super();
|
var ret = this._super();
|
||||||
|
@ -3891,7 +3891,6 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
||||||
if (!this.fields_view || !this.editable()){
|
if (!this.fields_view || !this.editable()){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
var r;
|
|
||||||
if (_.isEmpty(this.records.records)){
|
if (_.isEmpty(this.records.records)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3902,9 +3901,8 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
||||||
current_values[field.name] = field.get('value');
|
current_values[field.name] = field.get('value');
|
||||||
});
|
});
|
||||||
var valid = _.every(this.records.records, function(record){
|
var valid = _.every(this.records.records, function(record){
|
||||||
r = record;
|
|
||||||
_.each(self.editor.form.fields, function(field){
|
_.each(self.editor.form.fields, function(field){
|
||||||
field.set_value(r.attributes[field.name]);
|
field.set_value(record.attributes[field.name]);
|
||||||
});
|
});
|
||||||
return _.every(self.editor.form.fields, function(field){
|
return _.every(self.editor.form.fields, function(field){
|
||||||
field.process_modifiers();
|
field.process_modifiers();
|
||||||
|
@ -5477,11 +5475,11 @@ instance.web.form.FieldStatus = instance.web.form.AbstractField.extend({
|
||||||
calc_domain: function() {
|
calc_domain: function() {
|
||||||
var d = instance.web.pyeval.eval('domain', this.build_domain());
|
var d = instance.web.pyeval.eval('domain', this.build_domain());
|
||||||
var domain = []; //if there is no domain defined, fetch all the records
|
var domain = []; //if there is no domain defined, fetch all the records
|
||||||
|
|
||||||
if (d.length) {
|
if (d.length) {
|
||||||
domain = ['|',['id', '=', this.get('value')]].concat(d);
|
domain = ['|',['id', '=', this.get('value')]].concat(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! _.isEqual(domain, this.get("evaluated_selection_domain"))) {
|
if (! _.isEqual(domain, this.get("evaluated_selection_domain"))) {
|
||||||
this.set("evaluated_selection_domain", domain);
|
this.set("evaluated_selection_domain", domain);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue