Check for new record only when saving an actual current record

49cbc9b99ed8 added the calculation of a new variable but before the test that a
current record is actually being saved.

Closes #13946
This commit is contained in:
Cédric Krier
2025-03-28 16:04:21 +01:00
parent 275248478a
commit a6c548b400
+1 -1
View File
@@ -1631,7 +1631,6 @@
},
save_current: function() {
var current_record = this.current_record;
let new_record = current_record.id < 0;
if (!current_record) {
if (this.current_view &&
(this.current_view.view_type == 'tree') &&
@@ -1642,6 +1641,7 @@
return jQuery.when();
}
}
let new_record = current_record.id < 0;
if (this.current_view) {
this.current_view.set_value();
var fields = this.current_view.get_fields();