fix(todo): Use priority in source document, if available, for ToDo
This commit is contained in:
parent
f853313a5a
commit
daaae6786a
1 changed files with 17 additions and 16 deletions
|
|
@ -134,22 +134,23 @@ frappe.ui.form.AssignToDialog = Class.extend({
|
|||
var dialog = new frappe.ui.Dialog({
|
||||
title: __('Add to To Do'),
|
||||
fields: [
|
||||
{fieldtype: 'Link', fieldname:'assign_to', options:'User',
|
||||
label:__("Assign To"), reqd:true, filters: {'user_type': 'System User'}},
|
||||
{fieldtype:'Check', fieldname:'myself', label:__("Assign to me"), "default":0},
|
||||
{fieldtype:'Small Text', fieldname:'description', label:__("Comment")},
|
||||
{fieldtype: 'Section Break'},
|
||||
{fieldtype: 'Column Break'},
|
||||
{fieldtype:'Date', fieldname:'date', label: __("Complete By")},
|
||||
{fieldtype:'Check', fieldname:'notify',
|
||||
label:__("Notify by Email")},
|
||||
{fieldtype: 'Column Break'},
|
||||
{fieldtype:'Select', fieldname:'priority', label: __("Priority"),
|
||||
options:[
|
||||
{value:'Low', label:__('Low')},
|
||||
{value:'Medium', label:__('Medium')},
|
||||
{value:'High', label:__('High')}],
|
||||
'default':'Medium'},
|
||||
{ fieldtype: 'Link', fieldname: 'assign_to', options: 'User', label: __("Assign To"), reqd: true, filters: { 'user_type': 'System User' }},
|
||||
{ fieldtype: 'Check', fieldname: 'myself', label: __("Assign to me"), "default": 0 },
|
||||
{ fieldtype: 'Small Text', fieldname: 'description', label: __("Comment") },
|
||||
{ fieldtype: 'Section Break' },
|
||||
{ fieldtype: 'Column Break' },
|
||||
{ fieldtype: 'Date', fieldname: 'date', label: __("Complete By") },
|
||||
{ fieldtype: 'Check', fieldname: 'notify', label: __("Notify by Email") },
|
||||
{ fieldtype: 'Column Break' },
|
||||
{ fieldtype: 'Select', fieldname: 'priority', label: __("Priority"),
|
||||
options: [
|
||||
{ value: 'Low', label: __('Low') },
|
||||
{ value: 'Medium', label: __('Medium') },
|
||||
{ value: 'High', label: __('High') }
|
||||
],
|
||||
// Pick up priority from the source document, if it exists and is available in ToDo
|
||||
'default': ["Low", "Medium", "High"].includes(opts.obj.frm.doc.priority) ? opts.obj.frm.doc.priority : 'Medium'
|
||||
},
|
||||
],
|
||||
primary_action: function() { frappe.ui.add_assignment(opts, this) },
|
||||
primary_action_label: __("Add")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue