Skip to content

Fixes ISSUE-48341: Grid edit buttons disappear in some windows

The problem was only reproducible in grids where canvas field columns were displayed (i.e. Sales Order displays two by default, Delivery Status and Invoice Status). Those fields are managed by Smartclient as embeddedComponents and the area that contains the two buttons that disappear (OBGridButtonsComponent) is an embeddedComponent too. Whenever the user moves to a different row those components are recreated/recomputed (grid buttons here [1], canvas fields here [2]). Canvas fields are recomputed maintaining the row number they belong too, while grid buttons are recreated without a record number and rely on this smartclient function [3] to be assigned one. For that function to be executed, the first of the embedded components must have a null row number, so if there is a canvas field that happens to be the first component in the embeddedComponents array, the grid buttons component will not be assigned a row and thus will not be displayed.

Programatically assigning a row number on [1] when recomputing the grid buttons component does not work because [3] needs to be invoked (it sets a smartclient property that is not visible), so to fix the problem I am ensuring that when canvas fields are recomputed in [2], its row number is unset

[1] https://gitlab.com/openbravo/product/openbravo/-/blob/20904b11ad82f3cb37e2e3bce67127dedbf8d477/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js#L4963

[2] https://gitlab.com/openbravo/product/openbravo/-/blob/20904b11ad82f3cb37e2e3bce67127dedbf8d477/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js#L434

[3] https://gitlab.com/openbravo/tools/platform/org.openbravo.userinterface.smartclient.dev/-/blob/6b4f3f70cc3241de7eae4eba2f5e918586844729/web/org.openbravo.userinterface.smartclient/isomorphic/client/widgets/GridRenderer.js#L2599

Edited by Augusto Mauch

Merge request reports