Skip to content

Instantly share code, notes, and snippets.

@ernestoruiz89
Last active July 25, 2022 22:39
Show Gist options
  • Save ernestoruiz89/052d92c36b3c7fdd11deb9b75b93407d to your computer and use it in GitHub Desktop.
Save ernestoruiz89/052d92c36b3c7fdd11deb9b75b93407d to your computer and use it in GitHub Desktop.
frappe.ui.keys.add_shortcut({
shortcut: 'alt+p',
action: (e) => {
this.$item.find('.print-btn').trigger('click');
e.preventDefault();
return false;
},
condition: () => this.$component.is(':visible') && this.$summary_container.find('.print-btn').is(":visible"), //optional
description: __("Print Receipt"),
page: cur_page.page.page //optional
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment