resteve
(resteve)
June 14, 2021, 7:58am
1
Hie,
When a function field has “url” attribute defined in XML, not show the value (string) (only the icon).
In case in a function field, add the setter, in this case show icon and the value (string).
Why not show value content a function field without setter and url attribute?
I attach an image. Phone is a function field:
app_phone = fields.Function(fields.Char('Phone'), 'get_app_mechanism')
def get_app_mechanism(self, name):
ctype = 'tel' if name[4:] == 'phone' else 'mailto'
if self.value and self.type == name[4:]:
return self.value
# return '%s:%s' % (ctype, self.value)
return ''
pokoli
(Sergi Almacellas Abellana)
June 14, 2021, 8:48am
2
This is strange behaviour, adding a setter should not change how the field is show on a list bit. Probably the diference between both is that the setter makes the readonly definition of the field set to false.
Does the tryton client have the same behaviour as sao?
ced
(Cédric Krier)
June 14, 2021, 12:06pm
4
This is the expected behavior. When the field is readonly we do not display the input and we display it when it is not readonly.
dave
(David Harper)
June 14, 2021, 12:26pm
5
Just for the record, this is similar to a question I asked a while back: Why are email fields hidden on deactivated records?
albert
(Albert Cervera i Areny)
June 14, 2021, 3:52pm
6
Is there a good reason for that? Doesn’t seem most people (including myself) find it like the expected or desirable behaviour.
ced
(Cédric Krier)
June 14, 2021, 4:04pm
7
Why showing complex and long URL that the user can not edit but only click on it?
The goal is to simplify the UI.
resteve
(resteve)
June 15, 2021, 7:28am
8
User don’t know in tree view that url icon has or not a valued (an url).
Email and phone the url are short. Example: mailto:hello@tryton.org
A long url, could slide some characters. Example: https://discuss.tryton.org/t/not-s …
Also I don’t understand that tree view is not editable and function field not show the valued except when has a setter method.
ced
(Cédric Krier)
June 15, 2021, 8:02am
9
Make a patch to improve the display of the icon
Make a patch to not show the content on non editable tree view.