From 89b543d24015f9264b9c37f2198d98f9a37044e8 Mon Sep 17 00:00:00 2001 From: Hugo Trentesaux <hugo@le-filament.com> Date: Thu, 27 Feb 2025 10:43:40 +0100 Subject: [PATCH] review: compute name using partner_firstname method --- controllers/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/main.py b/controllers/main.py index 731f6a0..e78a072 100644 --- a/controllers/main.py +++ b/controllers/main.py @@ -1,7 +1,6 @@ from odoo import http, tools, _ from odoo.addons.auth_signup.controllers.main import AuthSignupHome - class SolagroAuthSignupHome(AuthSignupHome): @http.route('/web/signup', type='http', auth='public', website=True, sitemap=False) def web_auth_signup(self, **post): @@ -16,7 +15,8 @@ class SolagroAuthSignupHome(AuthSignupHome): if post and http.request.httprequest.method == 'POST': firstname = post.get('firstname') lastname = post.get('lastname') - post["name"] = firstname + " " + lastname + # compute name using partner_firstname method + post["name"] = http.request.env['res.partner']._get_computed_name(firstname, lastname) # update request params because super() uses this instead of kwargs http.request.params.update(post) return super().web_auth_signup(**post) -- GitLab