Merge branch 'develop' into patch-9

This commit is contained in:
Deepesh Garg
2022-11-09 09:19:28 +05:30
committed by GitHub
6 changed files with 238 additions and 216 deletions

View File

@@ -100,9 +100,7 @@ def get_default_holiday_list():
def check_if_within_operating_hours(workstation, operation, from_datetime, to_datetime): def check_if_within_operating_hours(workstation, operation, from_datetime, to_datetime):
if from_datetime and to_datetime: if from_datetime and to_datetime:
if not cint( if not frappe.db.get_single_value("Manufacturing Settings", "allow_production_on_holidays"):
frappe.db.get_value("Manufacturing Settings", None, "allow_production_on_holidays")
):
check_workstation_for_holiday(workstation, from_datetime, to_datetime) check_workstation_for_holiday(workstation, from_datetime, to_datetime)
if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_overtime")): if not cint(frappe.db.get_value("Manufacturing Settings", None, "allow_overtime")):

View File

@@ -92,18 +92,26 @@ frappe.ui.form.on("Timesheet", {
frm.fields_dict["time_logs"].grid.toggle_enable("billing_hours", false); frm.fields_dict["time_logs"].grid.toggle_enable("billing_hours", false);
frm.fields_dict["time_logs"].grid.toggle_enable("is_billable", false); frm.fields_dict["time_logs"].grid.toggle_enable("is_billable", false);
} }
let filters = {
"status": "Open"
};
if (frm.doc.customer) {
filters["customer"] = frm.doc.customer;
}
frm.set_query('parent_project', function(doc) {
return {
filters: filters
};
});
frm.trigger('setup_filters'); frm.trigger('setup_filters');
frm.trigger('set_dynamic_field_label'); frm.trigger('set_dynamic_field_label');
}, },
customer: function(frm) { customer: function(frm) {
frm.set_query('parent_project', function(doc) {
return {
filters: {
"customer": doc.customer
}
};
});
frm.set_query('project', 'time_logs', function(doc) { frm.set_query('project', 'time_logs', function(doc) {
return { return {
filters: { filters: {

View File

@@ -3,7 +3,6 @@ frappe.listview_settings['Stock Entry'] = {
"`tabStock Entry`.`purpose`", "`tabStock Entry`.`work_order`", "`tabStock Entry`.`bom_no`", "`tabStock Entry`.`purpose`", "`tabStock Entry`.`work_order`", "`tabStock Entry`.`bom_no`",
"`tabStock Entry`.`is_return`"], "`tabStock Entry`.`is_return`"],
get_indicator: function (doc) { get_indicator: function (doc) {
debugger
if(doc.is_return===1 && doc.purpose === "Material Transfer for Manufacture") { if(doc.is_return===1 && doc.purpose === "Material Transfer for Manufacture") {
return [__("Material Returned from WIP"), "orange", return [__("Material Returned from WIP"), "orange",
"is_return,=,1|purpose,=,Material Transfer for Manufacture|docstatus,<,2"]; "is_return,=,1|purpose,=,Material Transfer for Manufacture|docstatus,<,2"];

View File

@@ -57,6 +57,18 @@ frappe.ui.form.on('Subcontracting Receipt', {
filters: { 'company': frm.doc.company } filters: { 'company': frm.doc.company }
}; };
}); });
frappe.db.get_single_value('Buying Settings', 'backflush_raw_materials_of_subcontract_based_on').then(val => {
if (val == 'Material Transferred for Subcontract') {
frm.fields_dict['supplied_items'].grid.grid_rows.forEach((grid_row) => {
grid_row.docfields.forEach((df) => {
if (df.fieldname == 'consumed_qty') {
df.read_only = 0;
}
});
});
}
});
}, },
refresh: (frm) => { refresh: (frm) => {

View File

@@ -4,6 +4,9 @@ from frappe import _
def get_data(): def get_data():
return { return {
"fieldname": "subcontracting_receipt_no", "fieldname": "subcontracting_receipt_no",
"non_standard_fieldnames": {
"Subcontracting Receipt": "return_against",
},
"internal_links": { "internal_links": {
"Subcontracting Order": ["items", "subcontracting_order"], "Subcontracting Order": ["items", "subcontracting_order"],
"Project": ["items", "project"], "Project": ["items", "project"],
@@ -11,5 +14,6 @@ def get_data():
}, },
"transactions": [ "transactions": [
{"label": _("Reference"), "items": ["Subcontracting Order", "Quality Inspection", "Project"]}, {"label": _("Reference"), "items": ["Subcontracting Order", "Quality Inspection", "Project"]},
{"label": _("Returns"), "items": ["Subcontracting Receipt"]},
], ],
} }

View File

@@ -1,207 +1,208 @@
{ {
"actions": [], "actions": [],
"creation": "2022-04-18 10:45:16.538479", "creation": "2022-04-18 10:45:16.538479",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"main_item_code", "main_item_code",
"rm_item_code", "rm_item_code",
"item_name", "item_name",
"bom_detail_no", "bom_detail_no",
"col_break1", "col_break1",
"description", "description",
"stock_uom", "stock_uom",
"conversion_factor", "conversion_factor",
"reference_name", "reference_name",
"secbreak_1", "secbreak_1",
"rate", "rate",
"col_break2", "col_break2",
"amount", "amount",
"secbreak_2", "secbreak_2",
"available_qty_for_consumption", "available_qty_for_consumption",
"required_qty", "required_qty",
"col_break3", "col_break3",
"consumed_qty", "consumed_qty",
"current_stock", "current_stock",
"secbreak_3", "secbreak_3",
"batch_no", "batch_no",
"col_break4", "col_break4",
"serial_no", "serial_no",
"subcontracting_order" "subcontracting_order"
], ],
"fields": [ "fields": [
{ {
"fieldname": "main_item_code", "fieldname": "main_item_code",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Item Code", "label": "Item Code",
"options": "Item", "options": "Item",
"read_only": 1 "read_only": 1
}, },
{ {
"fieldname": "rm_item_code", "fieldname": "rm_item_code",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Raw Material Item Code", "label": "Raw Material Item Code",
"options": "Item", "options": "Item",
"read_only": 1 "read_only": 1
}, },
{ {
"fieldname": "description", "fieldname": "description",
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"in_global_search": 1, "in_global_search": 1,
"label": "Description", "label": "Description",
"print_width": "300px", "print_width": "300px",
"read_only": 1, "read_only": 1,
"width": "300px" "width": "300px"
}, },
{ {
"fieldname": "batch_no", "fieldname": "batch_no",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Batch No", "label": "Batch No",
"no_copy": 1, "no_copy": 1,
"options": "Batch" "options": "Batch"
}, },
{ {
"fieldname": "serial_no", "fieldname": "serial_no",
"fieldtype": "Text", "fieldtype": "Text",
"label": "Serial No", "label": "Serial No",
"no_copy": 1 "no_copy": 1
}, },
{ {
"fieldname": "col_break1", "fieldname": "col_break1",
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"fieldname": "required_qty", "fieldname": "required_qty",
"fieldtype": "Float", "fieldtype": "Float",
"label": "Required Qty", "label": "Required Qty",
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1
}, },
{ {
"columns": 2, "columns": 2,
"fieldname": "consumed_qty", "fieldname": "consumed_qty",
"fieldtype": "Float", "fieldtype": "Float",
"in_list_view": 1, "in_list_view": 1,
"label": "Consumed Qty", "label": "Consumed Qty",
"reqd": 1 "read_only": 1,
}, "reqd": 1
{ },
"fieldname": "stock_uom", {
"fieldtype": "Link", "fieldname": "stock_uom",
"label": "Stock Uom", "fieldtype": "Link",
"options": "UOM", "label": "Stock Uom",
"read_only": 1 "options": "UOM",
}, "read_only": 1
{ },
"fieldname": "rate", {
"fieldtype": "Currency", "fieldname": "rate",
"label": "Rate", "fieldtype": "Currency",
"options": "Company:company:default_currency", "label": "Rate",
"read_only": 1 "options": "Company:company:default_currency",
}, "read_only": 1
{ },
"fieldname": "amount", {
"fieldtype": "Currency", "fieldname": "amount",
"label": "Amount", "fieldtype": "Currency",
"options": "Company:company:default_currency", "label": "Amount",
"read_only": 1 "options": "Company:company:default_currency",
}, "read_only": 1
{ },
"default": "1", {
"fieldname": "conversion_factor", "default": "1",
"fieldtype": "Float", "fieldname": "conversion_factor",
"hidden": 1, "fieldtype": "Float",
"label": "Conversion Factor", "hidden": 1,
"read_only": 1 "label": "Conversion Factor",
}, "read_only": 1
{ },
"fieldname": "current_stock", {
"fieldtype": "Float", "fieldname": "current_stock",
"in_list_view": 1, "fieldtype": "Float",
"label": "Current Stock", "in_list_view": 1,
"read_only": 1 "label": "Current Stock",
}, "read_only": 1
{ },
"fieldname": "reference_name", {
"fieldtype": "Data", "fieldname": "reference_name",
"hidden": 1, "fieldtype": "Data",
"in_list_view": 1, "hidden": 1,
"label": "Reference Name", "in_list_view": 1,
"read_only": 1 "label": "Reference Name",
}, "read_only": 1
{ },
"fieldname": "bom_detail_no", {
"fieldtype": "Data", "fieldname": "bom_detail_no",
"hidden": 1, "fieldtype": "Data",
"in_list_view": 1, "hidden": 1,
"label": "BOM Detail No", "in_list_view": 1,
"read_only": 1 "label": "BOM Detail No",
}, "read_only": 1
{ },
"fieldname": "secbreak_1", {
"fieldtype": "Section Break" "fieldname": "secbreak_1",
}, "fieldtype": "Section Break"
{ },
"fieldname": "col_break2", {
"fieldtype": "Column Break" "fieldname": "col_break2",
}, "fieldtype": "Column Break"
{ },
"fieldname": "secbreak_2", {
"fieldtype": "Section Break" "fieldname": "secbreak_2",
}, "fieldtype": "Section Break"
{ },
"fieldname": "col_break3", {
"fieldtype": "Column Break" "fieldname": "col_break3",
}, "fieldtype": "Column Break"
{ },
"fieldname": "secbreak_3", {
"fieldtype": "Section Break" "fieldname": "secbreak_3",
}, "fieldtype": "Section Break"
{ },
"fieldname": "col_break4", {
"fieldtype": "Column Break" "fieldname": "col_break4",
}, "fieldtype": "Column Break"
{ },
"fieldname": "item_name", {
"fieldtype": "Data", "fieldname": "item_name",
"label": "Item Name", "fieldtype": "Data",
"read_only": 1 "label": "Item Name",
}, "read_only": 1
{ },
"fieldname": "subcontracting_order", {
"fieldtype": "Link", "fieldname": "subcontracting_order",
"hidden": 1, "fieldtype": "Link",
"label": "Subcontracting Order", "hidden": 1,
"no_copy": 1, "label": "Subcontracting Order",
"options": "Subcontracting Order", "no_copy": 1,
"print_hide": 1, "options": "Subcontracting Order",
"read_only": 1 "print_hide": 1,
}, "read_only": 1
{ },
"default": "0", {
"fieldname": "available_qty_for_consumption", "default": "0",
"fieldtype": "Float", "fieldname": "available_qty_for_consumption",
"in_list_view": 1, "fieldtype": "Float",
"label": "Available Qty For Consumption", "in_list_view": 1,
"print_hide": 1, "label": "Available Qty For Consumption",
"read_only": 1 "print_hide": 1,
} "read_only": 1
], }
"idx": 1, ],
"istable": 1, "idx": 1,
"links": [], "istable": 1,
"modified": "2022-09-02 22:28:53.392381", "links": [],
"modified_by": "Administrator", "modified": "2022-11-07 17:17:21.670761",
"module": "Subcontracting", "modified_by": "Administrator",
"name": "Subcontracting Receipt Supplied Item", "module": "Subcontracting",
"naming_rule": "Autoincrement", "name": "Subcontracting Receipt Supplied Item",
"owner": "Administrator", "naming_rule": "Autoincrement",
"permissions": [], "owner": "Administrator",
"sort_field": "modified", "permissions": [],
"sort_order": "DESC", "sort_field": "modified",
"states": [], "sort_order": "DESC",
"track_changes": 1 "states": [],
"track_changes": 1
} }