Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Set customer only if contact is present #23704

Merged
merged 1 commit into from
Oct 22, 2020
Merged

fix: Set customer only if contact is present #23704

merged 1 commit into from
Oct 22, 2020

Conversation

surajshetty3416
Copy link
Member

to avoid

Traceback (most recent call last):
  File "/home/frappe/frappe-io-bench/apps/erpnext/erpnext/erpnext_integrations/exotel_integration.py", line 22, in handle_incoming_call
    create_call_log(call_payload)
  File "/home/frappe/frappe-io-bench/apps/erpnext/erpnext/erpnext_integrations/exotel_integration.py", line 64, in create_call_log
    call_log.save(ignore_permissions=True)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 285, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 307, in _save
    self.insert()
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 231, in insert
    self.run_method("before_insert")
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 831, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 1116, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 1099, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 825, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-io-bench/apps/erpnext/erpnext/communication/doctype/call_log/call_log.py", line 19, in before_insert
    contact = frappe.get_doc("Contact", self.contact)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/__init__.py", line 794, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 75, in get_doc
    return controller(*args, **kwargs)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 113, in __init__
    self.load_from_db()
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/model/document.py", line 156, in load_from_db
    frappe.throw(_("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/__init__.py", line 413, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red', is_minimizable=is_minimizable, wide=wide)
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/__init__.py", line 392, in msgprint
    _raise_exception()
  File "/home/frappe/frappe-io-bench/apps/frappe/frappe/__init__.py", line 340, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.DoesNotExistError: Contact None not found

while creation of call log

@surajshetty3416 surajshetty3416 merged commit 6a0eb61 into frappe:develop Oct 22, 2020
@surajshetty3416 surajshetty3416 deleted the fix-call-log-failure branch October 22, 2020 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant