fix: Map custom job card create button with dashboard

This commit is contained in:
Rohit Waghchaure
2019-12-24 12:08:58 +05:30
parent 3881ce94ef
commit 7bbeb31015
2 changed files with 7 additions and 1 deletions

View File

@@ -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"), () => {

View File

@@ -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') {