@@ -217,7 +217,7 @@ | |||||
"bold": 0, | "bold": 0, | ||||
"collapsible": 0, | "collapsible": 0, | ||||
"columns": 0, | "columns": 0, | ||||
"description": "Example: status == \"Open\"", | |||||
"description": "Simple Python Expression, Example: status == 'Open' and type == 'Bug'", | |||||
"fieldname": "assign_condition", | "fieldname": "assign_condition", | ||||
"fieldtype": "Small Text", | "fieldtype": "Small Text", | ||||
"hidden": 0, | "hidden": 0, | ||||
@@ -281,7 +281,7 @@ | |||||
"bold": 0, | "bold": 0, | ||||
"collapsible": 0, | "collapsible": 0, | ||||
"columns": 0, | "columns": 0, | ||||
"description": "Example: Status in (\"Closed\", \"Cancelled\")", | |||||
"description": "Simple Python Expression, Example: Status in (\"Closed\", \"Cancelled\")", | |||||
"fieldname": "unassign_condition", | "fieldname": "unassign_condition", | ||||
"fieldtype": "Small Text", | "fieldtype": "Small Text", | ||||
"hidden": 0, | "hidden": 0, | ||||
@@ -449,7 +449,7 @@ | |||||
"issingle": 0, | "issingle": 0, | ||||
"istable": 0, | "istable": 0, | ||||
"max_attachments": 0, | "max_attachments": 0, | ||||
"modified": "2019-02-28 17:12:44.413781", | |||||
"modified": "2019-02-28 17:12:44.413782", | |||||
"modified_by": "Administrator", | "modified_by": "Administrator", | ||||
"module": "Automation", | "module": "Automation", | ||||
"name": "Assignment Rule", | "name": "Assignment Rule", | ||||
@@ -16,7 +16,7 @@ class AssignmentRule(Document): | |||||
frappe.cache().delete_value('assignment_rule') | frappe.cache().delete_value('assignment_rule') | ||||
def apply(self, doc): | def apply(self, doc): | ||||
if self.safe_eval('assign_condition', doc): | |||||
if not assign_to.get(doc) and self.safe_eval('assign_condition', doc): | |||||
self.do_assignment(doc) | self.do_assignment(doc) | ||||
return True | return True | ||||
@@ -130,7 +130,7 @@ def get_assignment_rule(): | |||||
priority = 0, | priority = 0, | ||||
document_type = 'Note', | document_type = 'Note', | ||||
assign_condition = 'public == 1', | assign_condition = 'public == 1', | ||||
unassign_condition = 'public == 0', | |||||
unassign_condition = 'pubic == 0 or notify_on_login == 1', | |||||
rule = 'Round Robin', | rule = 'Round Robin', | ||||
users = [ | users = [ | ||||
dict(user = 'test@example.com'), | dict(user = 'test@example.com'), | ||||
@@ -6,7 +6,6 @@ from __future__ import unicode_literals | |||||
import frappe | import frappe | ||||
from frappe import _ | from frappe import _ | ||||
from frappe.desk.form.load import get_docinfo | |||||
import frappe.share | import frappe.share | ||||
class DuplicateToDoError(frappe.ValidationError): pass | class DuplicateToDoError(frappe.ValidationError): pass | ||||
@@ -16,15 +15,10 @@ def get(args=None): | |||||
if not args: | if not args: | ||||
args = frappe.local.form_dict | args = frappe.local.form_dict | ||||
get_docinfo(frappe.get_doc(args.get("doctype"), args.get("name"))) | |||||
return frappe.db.sql("""SELECT `owner`, `description` | |||||
FROM `tabToDo` | |||||
WHERE reference_type=%(doctype)s | |||||
AND reference_name=%(name)s | |||||
AND status='Open' | |||||
ORDER BY modified DESC | |||||
LIMIT 5""", args, as_dict=True) | |||||
return frappe.get_all('ToDo', fields = ['owner', 'description'], filters = dict( | |||||
reference_type = args.get('doctype'), | |||||
reference_name = args.get('name') | |||||
), limit = 5) | |||||
@frappe.whitelist() | @frappe.whitelist() | ||||
def add(args=None): | def add(args=None): | ||||