WIP: inconsistent listbox proxy fields for modules
Since 76282344 , most modules do not have a count method anymore.
But not all of them, because we have two proxy fields for listboxs , my_list_mode_listbox and my_view_mode_module_listbox that are not used consistently.
$ git grep my_list_mode_listbox | wc -l 196 $ git grep my_view_mode_module_listbox | wc -l 64
According to https://www.erp5.com/erp5-HowTo.Configure.Proxy.Field/erp5-Guideline.Form.Profixification/#the-semantic-field-name-needs-to-be-associated-with-the-technical-context the
technical_context_name for module listbox is
list_mode, so my understanding is that modules should not use my_view_mode_module_listbox because this is not view_mode, so my_list_mode_listbox sounds better.
I am planning to change all users of my_view_mode_module_listbox to use my_list_mode_listbox , but I would like to make sure my understanding is correct and we agree on this.
I would be in favour of dropping my_list_mode (so moving it to legacy bt) and keeping only my_view_mode_module_listbox.
Having different technical_context_name is useful when we have really specific context. I think "dialog_mode" is useful because we use fields like "my_dialog_mode_format" which is usually only useful for dialogs. But for "list_mode", it can be seen just a view_mode for modules.
What needs attention is the usage of fields used to render listbox columns. It can be the same thing for a module or a document. For exemple this field (erp5_trade is one of the rare bt that was fully reviewed) :
It is a proxy to my_view_mode_listbox_read_only_start_date. For erp5_trade, list_mode was not used at all, this show that we can do without it.
So what do you think about removing "list_mode" in https://www.erp5.com/erp5-HowTo.Configure.Proxy.Field/erp5-Guideline.Form.Profixification/#the-semantic-field-name-needs-to-be-associated-with-the-technical-context ?
But list_mode exists for documents too, which is different from view_mode: it is what is used to display subdocument listboxes as full-page lists, allowing copy/paste/delete/... . So naming list_mode a "view_mode for module" is inconsistent. This is why we use list_mode on modules and not view_mode.