Some empty items appears in Action button dropdown in Sales Order screen

We have implemented a workflow in sales order doctype. When select any record which is in submit mode (docStatus = 1), some empty action items appears under action button drop-down as shown below. We checked the code but couldn’t identify the issue. Does anyone have any idea about the issue or faced this issue earlier?

image

We are using following version of ERPNext and Frappe:

ERPNext: v14.16.1
Frappe Framework: v14.25.4

Hello, I believe it’s a bug. Since we don’t use the workflow buttons, a solution was to hide them. If the solution is to hide them, please follow these steps:

  1. Inspect the browser’s source code to find the data-label of the workflow button.
  2. Then, in the doctype’s listview script (doctype_listview.js), add the following code:
 refresh: function(listview) {
	 var example = listview.$page.find(`[data-label='example']`);
	 example.hide(); 
	 example.parent().hide();
	 example.parent().parent().hide();

Please make sure to replace 'example' with the actual data-label value of the workflow button you found during inspection.

1 Like

Thanks @VictorHugo99 for the reply. We will patch this bug for the time being with the code snippet that you have provided and update you about the result of it.

Whether this has been addressed in recent releases of ERPNEXT/Frappe in the last 4-5 months?

Whether this custom code can be placed in custom JS and file and hook it? so that our ERPNEXT/FRAPPE update/upgrade would be smooth. This can be achieved then it would be highly appreciable.

1 Like

Hi, @pioonerpathan.

I don’t have information about this, and I believe it’s a good idea to place it in a hook file.