From 7226268a08a0f4b40e8b7ab4ce93dd3d9559fe56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 8 May 2025 18:15:25 +0200 Subject: [PATCH] Consider any field of new record as loaded It is needed to trigger the validation of all the fields to set default value thanks to the domain inversion. Closes #14004 --- sao/src/model.js | 3 +++ tryton/tryton/gui/window/view_form/model/record.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/sao/src/model.js b/sao/src/model.js index c345788189..6d0ac60a09 100644 --- a/sao/src/model.js +++ b/sao/src/model.js @@ -1367,6 +1367,9 @@ } }, get_loaded: function(fields) { + if (this.id < 0) { + return true; + } if (!fields) { fields = Object.keys(this.model.fields); } diff --git a/tryton/tryton/gui/window/view_form/model/record.py b/tryton/tryton/gui/window/view_form/model/record.py index 42665f9cf8..614095a52a 100644 --- a/tryton/tryton/gui/window/view_form/model/record.py +++ b/tryton/tryton/gui/window/view_form/model/record.py @@ -303,6 +303,8 @@ class Record: self.reload(fields) def get_loaded(self, fields=None): + if self.id < 0: + return True if fields is None: fields = self.group.fields.keys() return set(fields) <= (self._loaded | set(self.modified_fields))