htgoebel
(Hartmut Goebel)
June 3, 2024, 9:03am
1
According to the documentation , field
can have a string
attribute:
string
The string that is displayed for the widget.
Is this actually meant to be used in form views?
I tried this in a Form view, and the string is not shown.
I searched the source of all modules and the string
attribute seems to be used mainly in tree/list views.
On of the occurrences in a form view is in modules/stock/view/configuration_form.xml
, and here it has no effect, either, see screenshot
<label name="shipment_out_return_sequence" string="Customer Return Sequence"/>
<field name="shipment_out_return_sequence"/>
<label name="shipment_internal_sequence"/>
<field name="shipment_internal_sequence" string="Internal Sequence"/>
<label name="shipment_internal_transit"/>
<field name="shipment_internal_transit" string="Internal Transit"/>
Further more: It seems as if this is a bug in this very form definition, since for the other fields in this form have the string
attribute at the label.
pokoli
(Sergi Almacellas Abellana)
June 3, 2024, 9:11am
2
htgoebel:
Is this actually meant to be used in form views?
I tried this in a Form view, and the string is not shown.
In any view the string attribute of the field is set to the label with the same name as the field.
If you want to use a different string for the label, you can just set the string attribute on the view and this will override the value of the field.
String must be set on the label, not on the field.
htgoebel
(Hartmut Goebel)
June 3, 2024, 9:23am
3
In any view the string attribute of the field is set to the label with the same name as the field.
Thx for your quick answer. But what is the string
attribute for then? In the official modules it used about 29 times. And it is a valid attribute according the the RNG schema.
pokoli
(Sergi Almacellas Abellana)
June 3, 2024, 10:24am
4
The string attribute is used only for labels.
AFAIK its not usable for fields.
If it’s valid on the RNG schema probably we may consider removing it.
dave
(David Harper)
June 3, 2024, 11:05am
5
On Many2Many
fields (which are often put on the view without a label) the string
from the field
is shown at the top left of the widget.
1 Like
pokoli
(Sergi Almacellas Abellana)
June 3, 2024, 11:27am
7
This is also document and it was not true.
So probably the documentation needs to be updated also.