Add Menu Item in List View

Good Morning,

is there any possibility, to insert menu items into the list view of a document. In Detail view i have achieved through changing the docs js file and it works great.
My intention is to process things based on selected items in a list (e.g. Customers, Sales Invoices etc), but mostly in own app and module.

Any help again appreciated.
Thanks very much
Ralph

You have to include one .js and one .html file named doctype + _list inside associated doctype directory.
Check erpnext/erpnext/selling/doctype/sales_order at develop · frappe/erpnext · GitHub, as an example.

2 Likes

Thanks very much. I have reviewed the sales invoice related files but have some questions about the usage:

  1. The “add fields and filter” in the js seems to compose the query to the db, but when i make additional columns and try to insert the fields in the format % doc.fieldname % the y do not appear
  2. What is the format to insert the menu_item. can you give me a link to a js where this is achieved.

Thanks very much again.

Best Regards

Ralph

Menus are changing in v5 - you can write an onload method to add menu options.

See an example:

https://github.com/frappe/erpnext/blob/develop/erpnext/projects/doctype/time_log/time_log_list.js

1 Like

Thanks very much. Seems nothing is impossible. I replaced the logic with the one in the v5 time_log_list.js and it works fine. Thanks again for now

Hello,

Can I use custom script to make a custom field visible in the item list view?

thanks,
Sofia

You can make the custom field a part of the title:

https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/document-title

1 Like

@fuekor Can you share some hints how to add e.g. make sales invoice button in Delivery Note list-view menu…so we can select multiple DNs in list-view to create sales invoice from selected DNs…

Tks

+1
UI mods like this would come in very handy.

1 Like

See this for reference:

https://github.com/frappe/erpnext/blob/develop/erpnext/projects/doctype/time_log/time_log_list.js

1 Like

@rmehta - How can I add more fields in dropdown for sorting?

Make them mandatory or bold