fixes: internal issues (#19201)

* fix: Delivery Trip now has editable start address.

* fix: default party type not set in Journal Entry

* fix: maintainence visit purpose table not fetching item name

* fix: maintainence visit purpose table not fetching item name
This commit is contained in:
Saqib 2019-10-11 11:09:10 +05:30 committed by Nabin Hait
parent 1d781f13b2
commit 66762380ed
5 changed files with 162 additions and 339 deletions

View File

@ -40,7 +40,7 @@
"fields": [ "fields": [
{ {
"bold": 1, "bold": 1,
"columns": 3, "columns": 2,
"fieldname": "account", "fieldname": "account",
"fieldtype": "Link", "fieldtype": "Link",
"in_global_search": 1, "in_global_search": 1,
@ -90,14 +90,16 @@
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"default": "Customer",
"fieldname": "party_type", "fieldname": "party_type",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"label": "Party Type", "label": "Party Type",
"options": "DocType", "options": "DocType",
"search_index": 1 "search_index": 1
}, },
{ {
"columns": 3, "columns": 2,
"fieldname": "party", "fieldname": "party",
"fieldtype": "Dynamic Link", "fieldtype": "Dynamic Link",
"in_list_view": 1, "in_list_view": 1,
@ -270,7 +272,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2019-09-12 12:16:17.588399", "modified": "2019-10-02 12:23:21.693443",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Journal Entry Account", "name": "Journal Entry Account",

View File

@ -1,14 +1,36 @@
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors // Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on('Driver', { frappe.ui.form.on("Driver", {
setup: function(frm) { setup: function(frm) {
frm.set_query('transporter', function(){ frm.set_query("transporter", function() {
return { return {
filters: { filters: {
'is_transporter': 1 is_transporter: 1
} }
}; };
}); });
},
refresh: function(frm) {
frm.set_query("address", function() {
return {
filters: {
is_your_company_address: !frm.doc.transporter ? 1 : 0
}
};
});
},
transporter: function(frm, cdt, cdn) {
// this assumes that supplier's address has same title as supplier's name
frappe.db
.get_doc("Address", null, { address_title: frm.doc.transporter })
.then(r => {
frappe.model.set_value(cdt, cdn, "address", r.name);
})
.catch(err => {
console.log(err);
});
} }
}); });

View File

@ -4,6 +4,17 @@
frappe.provide("erpnext.maintenance"); frappe.provide("erpnext.maintenance");
frappe.ui.form.on('Maintenance Visit', { frappe.ui.form.on('Maintenance Visit', {
refresh: function(frm) {
//filters for serial_no based on item_code
frm.set_query('serial_no', 'purposes', function(frm, cdt, cdn) {
let item = locals[cdt][cdn];
return {
filters: {
'item_code': item.item_code
}
};
});
},
setup: function(frm) { setup: function(frm) {
frm.set_query('contact_person', erpnext.queries.contact_query); frm.set_query('contact_person', erpnext.queries.contact_query);
frm.set_query('customer_address', erpnext.queries.address_query); frm.set_query('customer_address', erpnext.queries.address_query);

View File

@ -1,348 +1,137 @@
{ {
"allow_copy": 0, "autoname": "hash",
"allow_import": 0, "creation": "2013-02-22 01:28:06",
"allow_rename": 0, "doctype": "DocType",
"autoname": "hash", "document_type": "Document",
"beta": 0, "editable_grid": 1,
"creation": "2013-02-22 01:28:06", "engine": "InnoDB",
"custom": 0, "field_order": [
"docstatus": 0, "item_code",
"doctype": "DocType", "item_name",
"document_type": "Document", "serial_no",
"editable_grid": 1, "description",
"engine": "InnoDB", "work_details",
"service_person",
"work_done",
"prevdoc_doctype",
"prevdoc_docname",
"prevdoc_detail_docname"
],
"fields": [ "fields": [
{ {
"allow_on_submit": 0, "fieldname": "item_code",
"bold": 0, "fieldtype": "Link",
"collapsible": 0, "in_list_view": 1,
"columns": 0, "label": "Item Code",
"fieldname": "item_code", "oldfieldname": "item_code",
"fieldtype": "Link", "oldfieldtype": "Link",
"hidden": 0, "options": "Item"
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Item Code",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_code",
"oldfieldtype": "Link",
"options": "Item",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_on_submit": 0, "fetch_from": "item_code.item_name",
"bold": 0, "fieldname": "item_name",
"collapsible": 0, "fieldtype": "Data",
"columns": 0, "in_global_search": 1,
"fieldname": "item_name", "in_list_view": 1,
"fieldtype": "Data", "label": "Item Name",
"hidden": 0, "oldfieldname": "item_name",
"ignore_user_permissions": 0, "oldfieldtype": "Data",
"ignore_xss_filter": 0, "read_only": 1
"in_filter": 0, },
"in_global_search": 1,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Item Name",
"length": 0,
"no_copy": 0,
"oldfieldname": "item_name",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_on_submit": 0, "fieldname": "serial_no",
"bold": 0, "fieldtype": "Link",
"collapsible": 0, "label": "Serial No",
"columns": 0, "oldfieldname": "serial_no",
"fieldname": "serial_no", "oldfieldtype": "Small Text",
"fieldtype": "Small Text", "options": "Serial No"
"hidden": 0, },
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Serial No",
"length": 0,
"no_copy": 0,
"oldfieldname": "serial_no",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_on_submit": 0, "fieldname": "description",
"bold": 0, "fieldtype": "Text Editor",
"collapsible": 0, "in_list_view": 1,
"columns": 0, "label": "Description",
"fieldname": "description", "oldfieldname": "description",
"fieldtype": "Text Editor", "oldfieldtype": "Small Text",
"hidden": 0, "print_width": "300px",
"ignore_user_permissions": 0, "reqd": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Description",
"length": 0,
"no_copy": 0,
"oldfieldname": "description",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"print_width": "300px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "300px" "width": "300px"
}, },
{ {
"allow_on_submit": 0, "fieldname": "work_details",
"bold": 0, "fieldtype": "Section Break"
"collapsible": 0, },
"columns": 0,
"fieldname": "work_details",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_on_submit": 0, "fieldname": "service_person",
"bold": 0, "fieldtype": "Link",
"collapsible": 0, "in_list_view": 1,
"columns": 0, "label": "Sales Person",
"fieldname": "service_person", "oldfieldname": "service_person",
"fieldtype": "Link", "oldfieldtype": "Link",
"hidden": 0, "options": "Sales Person",
"ignore_user_permissions": 0, "reqd": 1
"ignore_xss_filter": 0, },
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Sales Person",
"length": 0,
"no_copy": 0,
"oldfieldname": "service_person",
"oldfieldtype": "Link",
"options": "Sales Person",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_on_submit": 0, "fieldname": "work_done",
"bold": 0, "fieldtype": "Small Text",
"collapsible": 0, "in_list_view": 1,
"columns": 0, "label": "Work Done",
"fieldname": "work_done", "oldfieldname": "work_done",
"fieldtype": "Small Text", "oldfieldtype": "Small Text",
"hidden": 0, "reqd": 1
"ignore_user_permissions": 0, },
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Work Done",
"length": 0,
"no_copy": 0,
"oldfieldname": "work_done",
"oldfieldtype": "Small Text",
"permlevel": 0,
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{ {
"allow_on_submit": 0, "fieldname": "prevdoc_doctype",
"bold": 0, "fieldtype": "Link",
"collapsible": 0, "label": "Document Type",
"columns": 0, "no_copy": 1,
"fieldname": "prevdoc_doctype", "oldfieldname": "prevdoc_doctype",
"fieldtype": "Link", "oldfieldtype": "Data",
"hidden": 0, "options": "DocType",
"ignore_user_permissions": 0, "print_hide": 1,
"ignore_xss_filter": 0, "print_width": "150px",
"in_filter": 0, "read_only": 1,
"in_global_search": 0, "report_hide": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Document Type",
"length": 0,
"no_copy": 1,
"oldfieldname": "prevdoc_doctype",
"oldfieldtype": "Data",
"options": "DocType",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "150px",
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "150px" "width": "150px"
}, },
{ {
"allow_on_submit": 0, "fieldname": "prevdoc_docname",
"bold": 0, "fieldtype": "Dynamic Link",
"collapsible": 0, "label": "Against Document No",
"columns": 0, "no_copy": 1,
"fieldname": "prevdoc_docname", "oldfieldname": "prevdoc_docname",
"fieldtype": "Dynamic Link", "oldfieldtype": "Data",
"hidden": 0, "options": "prevdoc_doctype",
"ignore_user_permissions": 0, "print_hide": 1,
"ignore_xss_filter": 0, "print_width": "160px",
"in_filter": 0, "read_only": 1,
"in_global_search": 0, "report_hide": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Against Document No",
"length": 0,
"no_copy": 1,
"oldfieldname": "prevdoc_docname",
"oldfieldtype": "Data",
"options": "prevdoc_doctype",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "160px",
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "160px" "width": "160px"
}, },
{ {
"allow_on_submit": 0, "fieldname": "prevdoc_detail_docname",
"bold": 0, "fieldtype": "Data",
"collapsible": 0, "hidden": 1,
"columns": 0, "label": "Against Document Detail No",
"fieldname": "prevdoc_detail_docname", "no_copy": 1,
"fieldtype": "Data", "oldfieldname": "prevdoc_detail_docname",
"hidden": 1, "oldfieldtype": "Data",
"ignore_user_permissions": 0, "print_hide": 1,
"ignore_xss_filter": 0, "print_width": "160px",
"in_filter": 0, "read_only": 1,
"in_global_search": 0, "report_hide": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Against Document Detail No",
"length": 0,
"no_copy": 1,
"oldfieldname": "prevdoc_detail_docname",
"oldfieldtype": "Data",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
"print_width": "160px",
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 1,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
"width": "160px" "width": "160px"
} }
], ],
"hide_heading": 0, "idx": 1,
"hide_toolbar": 0, "istable": 1,
"idx": 1, "modified": "2019-10-03 14:55:52.786805",
"image_view": 0, "modified_by": "Administrator",
"in_create": 0, "module": "Maintenance",
"name": "Maintenance Visit Purpose",
"is_submittable": 0, "owner": "ashwini@webnotestech.com",
"issingle": 0, "permissions": [],
"istable": 1, "sort_field": "modified",
"max_attachments": 0, "sort_order": "DESC",
"modified": "2017-02-17 17:06:11.910266", "track_changes": 1
"modified_by": "Administrator",
"module": "Maintenance",
"name": "Maintenance Visit Purpose",
"owner": "ashwini@webnotestech.com",
"permissions": [],
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"show_name_in_global_search": 0,
"track_changes": 1,
"track_seen": 0
} }

View File

@ -166,12 +166,11 @@
"fieldname": "driver_address", "fieldname": "driver_address",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Driver Address", "label": "Driver Address",
"options": "Address", "options": "Address"
"read_only": 1
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"modified": "2019-07-18 16:38:44.112651", "modified": "2019-09-27 15:43:01.975139",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Delivery Trip", "name": "Delivery Trip",