details:   https://code.tryton.org/tryton/commit/aff992b619df
branch:    default
user:      Nicolas Évrard <[email protected]>
date:      Thu Feb 26 17:07:01 2026 +0100
description:
        Do not set default values for new fields when there is no default

        Closes #14631
diffstat:

 sao/src/model.js |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (19 lines):

diff -r 33c3f66deb6f -r aff992b619df sao/src/model.js
--- a/sao/src/model.js  Thu Mar 19 14:49:33 2026 +0100
+++ b/sao/src/model.js  Thu Feb 26 17:07:01 2026 +0100
@@ -379,10 +379,12 @@
             if (new_.length && added.length) {
                 this.model.execute('default_get', [added, this.context])
                     .then(values => {
-                        for (const record of new_) {
-                            record.set_default(values, true, false);
+                        if (!jQuery.isEmptyObject(values)) {
+                            for (const record of new_) {
+                                record.set_default(values, true, false);
+                            }
+                            this.record_modified();
                         }
-                        this.record_modified();
                     });
             }
         };

Reply via email to