From 3ad60ab0dd0cf03dce0398483f4d8d84bc190627 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Sun, 27 Aug 2023 11:46:00 +0200 Subject: [PATCH] Create user applications as validated from user preferences Closes #12376 --- trytond/CHANGELOG | 1 + trytond/trytond/res/routes.py | 2 +- trytond/trytond/res/user.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/trytond/CHANGELOG b/trytond/CHANGELOG index 5901c90962..3af7b19d4a 100644 --- a/trytond/CHANGELOG +++ b/trytond/CHANGELOG @@ -1,3 +1,4 @@ +* Create user applications as validated from user preferences * Support GIN index with btree_gin PostgreSQL extension * Add a canonicalize function for domains * Enforce record rules when reading only non SQL fields (#12428) diff --git a/trytond/trytond/res/routes.py b/trytond/trytond/res/routes.py index 63b225c4b6..a9064c042b 100644 --- a/trytond/trytond/res/routes.py +++ b/trytond/trytond/res/routes.py @@ -42,7 +42,7 @@ def user_application(request, pool): user_id = None data['user'] = user_id data.pop('key', None) - data.pop('state', None) + data['state'] = 'requested' application, = UserApplication.create([data]) key = application.key UserApplication.delete(UserApplication.search([ diff --git a/trytond/trytond/res/user.py b/trytond/trytond/res/user.py index 095d2a97a9..8aa471eb1d 100644 --- a/trytond/trytond/res/user.py +++ b/trytond/trytond/res/user.py @@ -1164,7 +1164,7 @@ class UserApplication(Workflow, ModelSQL, ModelView): @classmethod def default_state(cls): - return 'requested' + return 'validated' @classmethod @ModelView.button