Merge pull request #45139 from frappe/mergify/bp/version-15-hotfix/pr-45130

refactor: change sales invoice button position (backport #45130)
This commit is contained in:
ruthra kumar
2025-01-08 09:01:59 +05:30
committed by GitHub
2 changed files with 45 additions and 42 deletions

View File

@@ -303,11 +303,10 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
}
const me = this;
if (!this.frm.is_new() && this.frm.doc.docstatus === 0 && frappe.model.can_create("Quality Inspection")) {
if (!this.frm.is_new() && this.frm.doc.docstatus === 0 && frappe.model.can_create("Quality Inspection") && this.frm.doc.update_stock) {
this.frm.add_custom_button(__("Quality Inspection(s)"), () => {
me.make_quality_inspection();
}, __("Create"));
this.frm.page.set_inner_btn_group_as_primary(__('Create'));
}
const inspection_type = ["Purchase Receipt", "Purchase Invoice", "Subcontracting Receipt"].includes(this.frm.doc.doctype)