I’m getting an error that I would like to avoid getting:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 55, in application
response = 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 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 907, 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 230, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 266, in _save
self._validate()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 400, in _validate
self._validate_links()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 640, in _validate_links
frappe.CancelledLinkError)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 316, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 306, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 279, in _raise_exception
raise raise_exception, encode(msg)
CancelledLinkError: Cannot link cancelled document: Row #1: Old Document Name: PO-00009
I’d like to avoid getting it because the whole purpose of my document is to link to cancelled documents (this is a controlled document feature I’m working on).
Is there a way to bypass or overwrite the validate links for specific fields? I don’t want to do it for every field (ignore_links).
I’ve tried this:
for doc in self.items:
doc.flags.ignore_links = True
Thanks in advance