Merge pull request #19442 from 0Pranav/maintainance-ux-fix

fix: maintenance schedule ux
This commit is contained in:
gavin 2019-10-30 17:51:55 +05:30 committed by GitHub
commit ad04d442a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -20,6 +20,12 @@ frappe.ui.form.on('Maintenance Schedule', {
frm.set_value({transaction_date: frappe.datetime.get_today()});
}
},
refresh: function(frm) {
setTimeout(() => {
frm.toggle_display('generate_schedule', !(frm.is_new()));
frm.toggle_display('schedule', !(frm.is_new()));
},10);
},
customer: function(frm) {
erpnext.utils.get_party_details(frm)
},

View File

@ -150,7 +150,7 @@ class MaintenanceSchedule(TransactionBase):
elif not d.no_of_visits:
throw(_("Please mention no of visits required"))
elif not d.sales_person:
throw(_("Please select Incharge Person's name"))
throw(_("Please select a Sales Person for item: {0}".format(d.item_name)))
if getdate(d.start_date) >= getdate(d.end_date):
throw(_("Start date should be less than end date for Item {0}").format(d.item_code))