Skip to Content
Menu
This question has been flagged
1 Reply
4061 Views

I want to only limited characters display in my Html Field 

for example :

note=field.Html(size=250)

but this is not worked 

Avatar
Discard
Best Answer

You use constrains decorator, for example:

@api.one
@api.constrains('note')
def _check_len_html(self):
    if len(self.note)>250:
        raise ValidationError("Html is too long")
Avatar
Discard
Author

how self.html works any idea it will get an error object has no attribute html i've tried this but it wont work

Sorry, my mistake, should be len(self.note)

Author

Thanks for your help i done this

Related Posts Replies Views Activity
3
Aug 24
5497
4
Jul 24
38801
5
Apr 23
93678
3
Nov 22
2952
3
Aug 22
3035