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
(grafted from 383b2df462a149197e6e795d595aa3ae1d07f611)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier
2025-03-28 16:04:21 +01:00
parent 6dbca3a3b8
commit dec2b0da9f
+1 -1
View File
@@ -1568,7 +1568,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') &&
@@ -1579,6 +1578,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();