ERPNext Conference 2019* ERPNext.com Blog

Notification for purchase order is not accepting conditions


#1

The Condition ‘doc.grand_total < 10000’ is invalid

when debugging:

TypeError: unorderable types: NoneType() < int()

full message:
Failed to load resource: the server responded with a status of 417 (EXPECTATION FAILED)
request.js:352 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py”, line 70, in validate_condition
frappe.safe_eval(self.condition, None, get_context(temp_doc))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1525, in safe_eval
return eval(code, eval_globals, eval_locals)
File “”, line 1, in
TypeError: unorderable types: NoneType() < int()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 271, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 886, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 786, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1056, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1039, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 780, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py”, line 38, in validate
self.validate_condition()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py”, line 72, in validate_condition
frappe.throw(
(“The Condition ‘{0}’ is invalid”).format(self.condition))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 360, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 346, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 315, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: The Condition ‘doc.grand_total < 10000’ is invalid

request.js:352 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py”, line 70, in validate_condition
frappe.safe_eval(self.condition, None, get_context(temp_doc))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1525, in safe_eval
return eval(code, eval_globals, eval_locals)
File “”, line 1, in
TypeError: unorderable types: NoneType() < int()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1036, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 271, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in save
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 886, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 786, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1056, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 1039, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 780, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py”, line 38, in validate
self.validate_condition()
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/doctype/notification/notification.py”, line 72, in validate_condition
frappe.throw(
(“The Condition ‘{0}’ is invalid”).format(self.condition))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 360, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 346, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 315, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError: The Condition ‘doc.grand_total < 10000’ is invalid


#2

I have same issue, are u already solved this issue?


#3

opened issue