Adding custom "create" button

Hi all,
so I want to add custom create button when submitting sales invoice. i need to add create “delivery trip” but without delivery note.
I already make the custom button, but when i click create delivery trip, it show message like “Delivery Note (sales_invoice_number) not found”. Below i give the code that i already write
anyone can help? thanks before

frappe.ui.form.on(‘Sales Invoice’, {
refresh: function(frm) {
frm.add_custom_button(__(‘Delivery Trip’), function(){
method: “erpnext.stock.doctype.delivery_note.delivery_note.make_delivery_trip”,
frm: cur_frm
}, __(“Create”));

You have to create a new method for that because the method erpnext.stock.doctype.delivery_note.delivery_note.make_delivery_trip is used for the delivery note so the problem is occurring.