[IMP] web: char field, password shouldn't be trimmed
Passwords are something we know that need to be exact. So, the regular behaviour where double spaces are changed to single ones and spaces are trimmed at the start and end of the string is not a good idea for passwords in general. Not that a lot of people put double spaces or space in the start or end of their passwords, but it happened and it is possible. So, if password is True on the field, it does not make any sense to trim it and let's support that in the web client (as the web client does the trimming) instead of putting trim=False on all password fields in the Python, risking to forget it for the next password field. closes odoo/odoo#99088 Signed-off-by: Josse Colpaert <jco@odoo.com>
This commit is contained in:
@@ -46,7 +46,7 @@ CharField.supportedTypes = ["char"];
|
||||
|
||||
CharField.extractProps = ({ attrs, field }) => {
|
||||
return {
|
||||
shouldTrim: field.trim,
|
||||
shouldTrim: field.trim && !archParseBoolean(attrs.password), // passwords shouldn't be trimmed
|
||||
maxLength: field.size,
|
||||
isTranslatable: field.translate,
|
||||
autocomplete: attrs.autocomplete,
|
||||
|
||||
Reference in New Issue
Block a user