[16.0][MIG] web_widget_char_size: Migration to 16.0#3008
[16.0][MIG] web_widget_char_size: Migration to 16.0#3008OCA-git-bot merged 7 commits intoOCA:16.0from
Conversation
7a1e6c1 to
2757a21
Compare
16f884f to
704616d
Compare
704616d to
f48ad0b
Compare
HekkiMelody
left a comment
There was a problem hiding this comment.
Functional review, LGTM
| const _extractProps = CharField.extractProps; | ||
| CharField.extractProps = ({attrs, field}) => { | ||
| return Object.assign(_extractProps({attrs, field}), { | ||
| maxLength: field.size || attrs.options.size, |
There was a problem hiding this comment.
nitpick(non-blocking): According to https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength it should be without the capital 'L'
Still works anyways tho
There was a problem hiding this comment.
Required to update actual definition in order to be aligned with HTML attributes name:
https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/views/fields/char/char_field.js#L80
There was a problem hiding this comment.
Everything is clear now, it's good as it is, thanks!
|
This PR has the |
|
Greetings @OCA/web-maintainers, would anyone mind giving this one a look? I personally think this is pretty useful :) |
CarlosRoca13
left a comment
There was a problem hiding this comment.
Thank you for your effort! Please check that when fields have a widget assigned, it is not working. For example, by adding the options to the phone field in the res.partner form. Try loading the asset right after the char_field is loaded. Here’s how to do it: https://www.odoo.com/documentation/17.0/es/developer/reference/frontend/assets.html#after
You also have examples in the code 😄
I didn't even know this was a thing, I thought it was a given that it would only work with the default char widget. Thank you for pointing it out! |
Hi, I tried to implement as suggested by keeping the web_widget_char_size definition after target file of actual char_field.js file. But, it did not help to use option="{'size': 10}" from the view definition. I also think that in order to use "option={size: 10}" in the char field which uses "widget=phone", updating PhoneField, FormPhoneField definition would help to achieve the same. As version 14 does not support this feature from web_widget_char_size module, is this addition required here? Please let me know your views on this observation and also correct me if I am wrong. |
CarlosRoca13
left a comment
There was a problem hiding this comment.
Okay, I see that PhoneField is not extending CharField. It’s a bit inconvenient, but I think we can do without it. If someone needs it in the future, we could create a web_widget_phone_size module.
/ocabot migration web_widget_char_size
/ocabot merge nobump
|
On my way to merge this fine PR! |
|
This PR has the |
|
Congratulations, your PR was merged at f3a122c. Thanks a lot for contributing to OCA. ❤️ |


Migrating web_widget_char_size to 16.0