Added default WIP Warehouse and FG Warehouse to Manufacturing Settings
Fetch default WIP Warehouse and FG Warehouse on load of Production Order
This commit is contained in:
@@ -1,123 +1,320 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
"creation": "2014-11-27 14:12:07.542534",
|
"creation": "2014-11-27 14:12:07.542534",
|
||||||
"custom": 0,
|
"custom": 0,
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Master",
|
"document_type": "Document",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldname": "capacity_planning",
|
"allow_on_submit": 0,
|
||||||
"fieldtype": "Section Break",
|
"fieldname": "capacity_planning",
|
||||||
"label": "Capacity Planning",
|
"fieldtype": "Section Break",
|
||||||
"permlevel": 0,
|
"hidden": 0,
|
||||||
"precision": ""
|
"ignore_user_permissions": 0,
|
||||||
},
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Capacity Planning",
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "Disables creation of time logs against Production Orders.\nOperations shall not be tracked against Production Order",
|
"allow_on_submit": 0,
|
||||||
"fieldname": "disable_capacity_planning",
|
"description": "Disables creation of time logs against Production Orders.\nOperations shall not be tracked against Production Order",
|
||||||
"fieldtype": "Check",
|
"fieldname": "disable_capacity_planning",
|
||||||
"label": "Disable Capacity Planning and Time Tracking",
|
"fieldtype": "Check",
|
||||||
"permlevel": 0,
|
"hidden": 0,
|
||||||
"precision": ""
|
"ignore_user_permissions": 0,
|
||||||
},
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Disable Capacity Planning and Time Tracking",
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "Plan time logs outside Workstation Working Hours.",
|
"allow_on_submit": 0,
|
||||||
"fieldname": "allow_overtime",
|
"description": "Plan time logs outside Workstation Working Hours.",
|
||||||
"fieldtype": "Check",
|
"fieldname": "allow_overtime",
|
||||||
"label": "Allow Overtime",
|
"fieldtype": "Check",
|
||||||
"permlevel": 0,
|
"hidden": 0,
|
||||||
"precision": ""
|
"ignore_user_permissions": 0,
|
||||||
},
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Allow Overtime",
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "",
|
"allow_on_submit": 0,
|
||||||
"fieldname": "allow_production_on_holidays",
|
"default": "",
|
||||||
"fieldtype": "Check",
|
"fieldname": "allow_production_on_holidays",
|
||||||
"in_list_view": 1,
|
"fieldtype": "Check",
|
||||||
"label": "Allow Production on Holidays",
|
"hidden": 0,
|
||||||
"options": "",
|
"ignore_user_permissions": 0,
|
||||||
"permlevel": 0,
|
"in_filter": 0,
|
||||||
"precision": ""
|
"in_list_view": 1,
|
||||||
},
|
"label": "Allow Production on Holidays",
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "BOM",
|
"allow_on_submit": 0,
|
||||||
"fieldname": "backflush_raw_materials_based_on",
|
"fieldname": "column_break_3",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Column Break",
|
||||||
"label": "Backflush Raw Materials Based On",
|
"hidden": 0,
|
||||||
"options": "BOM\nMaterial Transferred for Manufacture",
|
"ignore_user_permissions": 0,
|
||||||
"permlevel": 0,
|
"in_filter": 0,
|
||||||
"precision": ""
|
"in_list_view": 0,
|
||||||
},
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_3",
|
"allow_on_submit": 0,
|
||||||
"fieldtype": "Column Break",
|
"default": "30",
|
||||||
"permlevel": 0,
|
"description": "Try planning operations for X days in advance.",
|
||||||
"precision": ""
|
"fieldname": "capacity_planning_for_days",
|
||||||
},
|
"fieldtype": "Int",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Capacity Planning For (Days)",
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "30",
|
"allow_on_submit": 0,
|
||||||
"description": "Try planning operations for X days in advance.",
|
"description": "Default 10 mins",
|
||||||
"fieldname": "capacity_planning_for_days",
|
"fieldname": "mins_between_operations",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"label": "Capacity Planning For (Days)",
|
"hidden": 0,
|
||||||
"permlevel": 0,
|
"ignore_user_permissions": 0,
|
||||||
"precision": ""
|
"in_filter": 0,
|
||||||
},
|
"in_list_view": 0,
|
||||||
|
"label": "Time Between Operations (in mins)",
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "Default 10 mins",
|
"allow_on_submit": 0,
|
||||||
"fieldname": "mins_between_operations",
|
"fieldname": "section_break_6",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Section Break",
|
||||||
"label": "Time Between Operations (in mins)",
|
"hidden": 0,
|
||||||
"permlevel": 0,
|
"ignore_user_permissions": 0,
|
||||||
"precision": ""
|
"in_filter": 0,
|
||||||
},
|
"in_list_view": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "over_production_allowance_percentage",
|
"allow_on_submit": 0,
|
||||||
"fieldtype": "Percent",
|
"fieldname": "over_production_allowance_percentage",
|
||||||
"label": "Over Production Allowance Percentage",
|
"fieldtype": "Percent",
|
||||||
"permlevel": 0,
|
"hidden": 0,
|
||||||
"precision": ""
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Over Production Allowance Percentage",
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"default": "BOM",
|
||||||
|
"fieldname": "backflush_raw_materials_based_on",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Backflush Raw Materials Based On",
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "BOM\nMaterial Transferred for Manufacture",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"fieldname": "column_break_11",
|
||||||
|
"fieldtype": "Column Break",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"fieldname": "default_wip_warehouse",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Default Work In Progress Warehouse",
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Warehouse",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"fieldname": "default_fg_warehouse",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Default Finished Goods Warehouse",
|
||||||
|
"no_copy": 0,
|
||||||
|
"options": "Warehouse",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "icon-wrench",
|
"icon": "icon-wrench",
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
"in_dialog": 0,
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2015-08-12 08:12:33.889753",
|
"modified": "2015-08-21 08:27:03.794133",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Manufacturing",
|
"module": "Manufacturing",
|
||||||
"name": "Manufacturing Settings",
|
"name": "Manufacturing Settings",
|
||||||
"name_case": "",
|
"name_case": "",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
"amend": 0,
|
"amend": 0,
|
||||||
"apply_user_permissions": 0,
|
"apply_user_permissions": 0,
|
||||||
"cancel": 0,
|
"cancel": 0,
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 0,
|
"delete": 0,
|
||||||
"email": 0,
|
"email": 0,
|
||||||
"export": 0,
|
"export": 0,
|
||||||
"import": 0,
|
"if_owner": 0,
|
||||||
"permlevel": 0,
|
"import": 0,
|
||||||
"print": 0,
|
"permlevel": 0,
|
||||||
"read": 1,
|
"print": 0,
|
||||||
"report": 0,
|
"read": 1,
|
||||||
"role": "Manufacturing Manager",
|
"report": 0,
|
||||||
"set_user_permissions": 0,
|
"role": "Manufacturing Manager",
|
||||||
"share": 1,
|
"set_user_permissions": 0,
|
||||||
"submit": 0,
|
"share": 1,
|
||||||
|
"submit": 0,
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC"
|
"sort_order": "DESC"
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ frappe.ui.form.on("Production Order", "onload", function(frm) {
|
|||||||
erpnext.production_order.set_custom_buttons(frm);
|
erpnext.production_order.set_custom_buttons(frm);
|
||||||
erpnext.production_order.setup_company_filter(frm);
|
erpnext.production_order.setup_company_filter(frm);
|
||||||
erpnext.production_order.setup_bom_filter(frm);
|
erpnext.production_order.setup_bom_filter(frm);
|
||||||
|
erpnext.production_order.set_default_warehouse(frm);
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Production Order", "refresh", function(frm) {
|
frappe.ui.form.on("Production Order", "refresh", function(frm) {
|
||||||
@@ -138,10 +139,22 @@ erpnext.production_order = {
|
|||||||
}
|
}
|
||||||
} else msgprint(__("Please enter Production Item first"));
|
} else msgprint(__("Please enter Production Item first"));
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
set_default_warehouse: function(frm) {
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.manufacturing.doctype.production_order.production_order.get_default_warehouse",
|
||||||
|
|
||||||
|
callback: function(r) {
|
||||||
|
if(!r.exe) {
|
||||||
|
frm.set_value("wip_warehouse", r.message[0]);
|
||||||
|
frm.set_value("fg_warehouse", r.message[1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$.extend(cur_frm.cscript, {
|
$.extend(cur_frm.cscript, {
|
||||||
before_submit: function() {
|
before_submit: function() {
|
||||||
cur_frm.toggle_reqd(["fg_warehouse", "wip_warehouse"], true);
|
cur_frm.toggle_reqd(["fg_warehouse", "wip_warehouse"], true);
|
||||||
|
|||||||
@@ -422,3 +422,9 @@ def make_time_log(name, operation, from_time=None, to_time=None, qty=None, proj
|
|||||||
if from_time and to_time :
|
if from_time and to_time :
|
||||||
time_log.calculate_total_hours()
|
time_log.calculate_total_hours()
|
||||||
return time_log
|
return time_log
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_default_warehouse():
|
||||||
|
wip_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_wip_warehouse")
|
||||||
|
fg_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_fg_warehouse")
|
||||||
|
return wip_warehouse, fg_warehouse
|
||||||
Reference in New Issue
Block a user