Position copied records based on order

issue9474
review311851002
This commit is contained in:
Cédric Krier
2020-07-25 00:49:32 +02:00
parent b12ac9648b
commit 86fc6a581a
3 changed files with 8 additions and 3 deletions
+1
View File
@@ -1,3 +1,4 @@
* Position copied records based on order
* Sanitize translated RichtText fields content (issue9453)
* Allow configuration of default colors for graph and calendar
* Sanitize RichtText fields content (issue9405)
+6 -2
View File
@@ -79,7 +79,10 @@
this.__readonly = value;
}
});
array.load = function(ids, modified) {
array.load = function(ids, modified, position) {
if ((position === undefined) || (position == -1)) {
position = this.length;
}
var new_records = [];
var i, len;
for (i = 0, len = ids.length; i < len; i++) {
@@ -88,7 +91,8 @@
if (!new_record) {
new_record = new Sao.Record(this.model, id);
new_record.group = this;
this.push(new_record);
this.splice(position, 0, new_record);
position += 1;
}
new_records.push(new_record);
}
+1 -1
View File
@@ -1591,7 +1591,7 @@
var records = this.current_view.selected_records;
this.model.copy(records, this.context)
.then(function(new_ids) {
this.group.load(new_ids);
this.group.load(new_ids, false, this.new_position);
if (!jQuery.isEmptyObject(new_ids)) {
this.current_record = this.group.get(new_ids[0]);
}