Add only modified records of xxx2Many
issue6754 review38641002
This commit is contained in:
1 parent
c5fdd1a784
commit
da4b4d80ab
2 files changed
+20
-17
No files matched your search
+19
-16
@@ -152,6 +152,9 @@
|
||||
}
|
||||
this.record_deleted = record_deleted;
|
||||
if (new_records.length && modified) {
|
||||
new_records.forEach(function(record) {
|
||||
record._changed.id = true;
|
||||
});
|
||||
var root_group = this.root_group();
|
||||
this.changed().then(function() {
|
||||
root_group.screens.forEach(function(screen) {
|
||||
@@ -1964,14 +1967,15 @@
|
||||
}
|
||||
var values;
|
||||
if (record2.id >= 0) {
|
||||
values = record2.get();
|
||||
delete values[parent_name];
|
||||
if (record2.has_changed() &&
|
||||
!jQuery.isEmptyObject(values)) {
|
||||
to_write.push([record2.id]);
|
||||
to_write.push(values);
|
||||
if (record2.has_changed()) {
|
||||
values = record2.get();
|
||||
delete values[parent_name];
|
||||
if (!jQuery.isEmptyObject(values)) {
|
||||
to_write.push([record2.id]);
|
||||
to_write.push(values);
|
||||
}
|
||||
to_add.push(record2.id);
|
||||
}
|
||||
to_add.push(record2.id);
|
||||
} else {
|
||||
values = record2.get();
|
||||
delete values[parent_name];
|
||||
@@ -2141,17 +2145,16 @@
|
||||
record._values[this.name] = group;
|
||||
},
|
||||
get_timestamp: function(record) {
|
||||
var group = record._values[this.name];
|
||||
if (group === undefined) {
|
||||
return {};
|
||||
}
|
||||
|
||||
var timestamps = {};
|
||||
var group = record._values[this.name] || [];
|
||||
var records = group.filter(function(record) {
|
||||
return record.has_changed();
|
||||
});
|
||||
var record2;
|
||||
for (var i = 0, len = group.length; i < len; i++) {
|
||||
record2 = group[i];
|
||||
jQuery.extend(timestamps, record2.get_timestamp());
|
||||
}
|
||||
jQuery.extend(records, group.record_removed, group.record_deleted)
|
||||
.forEach(function(record) {
|
||||
jQuery.extend(timestamps, record.get_timestamp());
|
||||
});
|
||||
return timestamps;
|
||||
},
|
||||
get_eval: function(record) {
|
||||
|
||||
+1
-1
@@ -754,7 +754,7 @@
|
||||
expanded = expanded || [];
|
||||
var update_expander = function() {
|
||||
if (jQuery.isEmptyObject(
|
||||
this.record.field_get(
|
||||
this.record.field_get_client(
|
||||
this.children_field))) {
|
||||
this.expander.css('visibility', 'hidden');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user