mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-07 20:42:50 +00:00
fix: Map custom job card create button with dashboard
This commit is contained in:
@@ -3,6 +3,11 @@
|
||||
|
||||
frappe.ui.form.on('Job Card', {
|
||||
refresh: function(frm) {
|
||||
|
||||
if(frm.doc.docstatus == 0) {
|
||||
frm.set_df_property("operation", "read_only", frm.doc.operation_id ? 1 : 0);
|
||||
}
|
||||
|
||||
if(!frm.doc.__islocal && frm.doc.items && frm.doc.items.length) {
|
||||
if (frm.doc.for_quantity != frm.doc.transferred_qty) {
|
||||
frm.add_custom_button(__("Material Request"), () => {
|
||||
|
||||
@@ -6,6 +6,7 @@ frappe.ui.form.on("Work Order", {
|
||||
frm.custom_make_buttons = {
|
||||
'Stock Entry': 'Start',
|
||||
'Pick List': 'Create Pick List',
|
||||
'Job Card': 'Create Job Card',
|
||||
};
|
||||
|
||||
// Set query for warehouses
|
||||
@@ -136,7 +137,7 @@ frappe.ui.form.on("Work Order", {
|
||||
|
||||
if (frm.doc.docstatus === 1
|
||||
&& frm.doc.operations && frm.doc.operations.length
|
||||
&& frm.doc.qty != frm.doc.material_transferred_for_manufacturing) {
|
||||
&& frm.doc.qty != frm.doc.produced_qty) {
|
||||
|
||||
const not_completed = frm.doc.operations.filter(d => {
|
||||
if(d.status != 'Completed') {
|
||||
|
||||
Reference in New Issue
Block a user