Some times the useful information about a relate is just the numbers. For example on the party form, user may be just interested to know how much draft, validated and posted invoices have the party (or shipments or sale etc.). For now to have this information, the user has to open the relate and close it after to go back to the form.
We create a new kind of button
link. It takes an action window ID as attribute:
This will display a clickable box (on sao it will be a
btn-link class) with as content:
- If the action has not domain window, the name of the action followed by the number of record (using
ModelStorage.search_count) (on sao it will use a
- If the action has domain window, the name of action followed by the name of the domain and the number of record. One domain per line and only if the domain has count attribute set.
- Draft 3
- Validated 1
- Posted 6
The domains are evaluated with the current record as
The number are refreshed on each display call by as asynchronous call (like the domain window) to avoid blocking the UI.
The button could have an optional icon. For example, we could show the accounting icon on the invoice link.
When the user click on the button, it opens the action in a new tab (like the usual relate).
We should use those links in an harmonized way. They should be always be visible so we put them on top in a group with 4 cols next to the usual active field.
On party, we display most of the relates with such button.
On sale and purchase, they replace the invoices and shipments tabs.
On opportunities, they replace the sales tab.
On productions, they replace the works tab.
On product categories, we add a link to products.