[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) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2019-10-17 08:55:17 +00:00
committed by fw-bot
parent 566cfe3e4d
commit a3bbcb13f3
+1
View File
@@ -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})