mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 06:59:20 +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', {
|
frappe.ui.form.on('Job Card', {
|
||||||
refresh: function(frm) {
|
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.__islocal && frm.doc.items && frm.doc.items.length) {
|
||||||
if (frm.doc.for_quantity != frm.doc.transferred_qty) {
|
if (frm.doc.for_quantity != frm.doc.transferred_qty) {
|
||||||
frm.add_custom_button(__("Material Request"), () => {
|
frm.add_custom_button(__("Material Request"), () => {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ frappe.ui.form.on("Work Order", {
|
|||||||
frm.custom_make_buttons = {
|
frm.custom_make_buttons = {
|
||||||
'Stock Entry': 'Start',
|
'Stock Entry': 'Start',
|
||||||
'Pick List': 'Create Pick List',
|
'Pick List': 'Create Pick List',
|
||||||
|
'Job Card': 'Create Job Card',
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set query for warehouses
|
// Set query for warehouses
|
||||||
@@ -136,7 +137,7 @@ frappe.ui.form.on("Work Order", {
|
|||||||
|
|
||||||
if (frm.doc.docstatus === 1
|
if (frm.doc.docstatus === 1
|
||||||
&& frm.doc.operations && frm.doc.operations.length
|
&& 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 => {
|
const not_completed = frm.doc.operations.filter(d => {
|
||||||
if(d.status != 'Completed') {
|
if(d.status != 'Completed') {
|
||||||
|
|||||||
Reference in New Issue
Block a user