From a3bbcb13f3c383040e8a51099e16adb4ef55401b Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 15 Oct 2019 12:34:08 +0000 Subject: [PATCH] [FIX] portal: Portal user not able to update their details Steps to reproduce the bug: - Create a portal user U - Try to update the details of U from portal Bug: A server error was raised because the country_id was set as a character. opw:2082450 closes odoo/odoo#38924 X-original-commit: 009b632c552822cb9892a2ccdbe9d79947d88a34 Signed-off-by: Simon Goffin (sig) --- addons/portal/controllers/portal.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/portal/controllers/portal.py b/addons/portal/controllers/portal.py index 845c2936243..87e3108a2b3 100644 --- a/addons/portal/controllers/portal.py +++ b/addons/portal/controllers/portal.py @@ -174,6 +174,7 @@ class CustomerPortal(Controller): if not error: values = {key: post[key] for key in self.MANDATORY_BILLING_FIELDS} values.update({key: post[key] for key in self.OPTIONAL_BILLING_FIELDS if key in post}) + values.update({'country_id': int(values.pop('country_id', 0))}) values.update({'zip': values.pop('zipcode', '')}) if values.get('state_id') == '': values.update({'state_id': False})