ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Customizing "Menu" in Forms

customization

#1

Hello;

Where is the code that is related to the Menu (the Menu of the documents)? I need to do customization when selecting Duplicate.

Below is the image that show which Menu I mean:

MenuOfDocuments

Regards
Bilal


#2

Hi @bghayad,
do you want to change the behaviour of what happens on click of “Duplicate”? That would afaik require to change the core code.
If you can do with an additional menu entry, you can add another menu item. Create your behaviour in a custom script file (e.g. public/js/sales_invoice_list.js) in your custom app. Then, link the behaviour with an entry in your hooks.py

doctype_list_js = {"Sales Invoice" : "public/js/sales_invoice_list.js"} 

How to extend the list, refer to some_list.js file in ERPNext or e.g. https://github.com/libracore/erpnextswiss/blob/master/erpnextswiss/erpnextswiss/doctype/payment_reminder/payment_reminder_list.js


#3

Hello @lasalesi
Thanks a lot for your kindly help and reply.
What you suggested is very good an useful, but please find below my comments:

do you want to change the behaviour of what happens on click of “Duplicate”? That would afaik require to change the core code.

In case I need to change the behaviour of “Duplicate”, from where I can do this? Even if this is requiring to change in the core, because in my case, I have separated branch and separated upgrade procedure. So if you can guide me from where to be changed (even in the core), it will be appreciated.

Regards
Bilal