Not show string when widget has url and is a function field


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 ''

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?

GTK same as SAO

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.

Just for the record, this is similar to a question I asked a while back: Why are email fields hidden on deactivated records?

Is there a good reason for that? Doesn’t seem most people (including myself) find it like the expected or desirable behaviour.

Why showing complex and long URL that the user can not edit but only click on it?
The goal is to simplify the UI.

  1. User don’t know in tree view that url icon has or not a valued (an url).
  2. Email and phone the url are short. Example:
  3. A long url, could slide some characters. Example:

Also I don’t understand that tree view is not editable and function field not show the valued except when has a setter method.

Make a patch to improve the display of the icon

Make a patch to not show the content on non editable tree view.