From 91babec0c2ab492b7b8dbe26f26746891fb66fb2 Mon Sep 17 00:00:00 2001 From: prssanna Date: Tue, 20 Oct 2020 14:50:33 +0530 Subject: [PATCH] fix: add removed field --- .../doctype/assignment_rule/assignment_rule.json | 13 ++++++++++--- .../doctype/assignment_rule/assignment_rule.py | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frappe/automation/doctype/assignment_rule/assignment_rule.json b/frappe/automation/doctype/assignment_rule/assignment_rule.json index 415ebb1c45..0a57e06da6 100644 --- a/frappe/automation/doctype/assignment_rule/assignment_rule.json +++ b/frappe/automation/doctype/assignment_rule/assignment_rule.json @@ -136,15 +136,22 @@ }, { "depends_on": "document_type", + "description": "Value from this field will be set as the due date in the ToDo", "fieldname": "due_date_based_on", "fieldtype": "Select", - "label": "Due Date Based On", - "description": "Value from this field will be set as the due date in the ToDo" + "label": "Due Date Based On" + }, + { + "depends_on": "eval: doc.rule == 'Based on Field'", + "fieldname": "field", + "fieldtype": "Select", + "label": "Field", + "mandatory_depends_on": "eval: doc.rule == 'Based on Field'" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2020-10-13 06:48:54.019735", + "modified": "2020-10-20 14:47:20.662954", "modified_by": "Administrator", "module": "Automation", "name": "Assignment Rule", diff --git a/frappe/automation/doctype/assignment_rule/assignment_rule.py b/frappe/automation/doctype/assignment_rule/assignment_rule.py index 0187e87edf..c85cb149ea 100644 --- a/frappe/automation/doctype/assignment_rule/assignment_rule.py +++ b/frappe/automation/doctype/assignment_rule/assignment_rule.py @@ -82,7 +82,7 @@ class AssignmentRule(Document): elif self.rule == 'Load Balancing': return self.get_user_load_balancing() elif self.rule == 'Based on Field': - return doc[self.field] + return doc.get(self.field) def get_user_round_robin(self): '''