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: email digest original_user issue #27191

Merged
merged 3 commits into from
Aug 31, 2021

Conversation

pateljannat
Copy link
Contributor

Steps to replicate:

  1. Create an email digest. Save.
  2. From the top of the document click on Send Now.
  3. An error appears.

Screenshot 2021-08-27 at 10 50 56 AM

Traceback

Traceback (most recent call last):
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/app.py", line 68, in application
    response = frappe.api.handle()
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/__init__.py", line 1172, in call
    return fn(*args, **newargs)
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/handler.py", line 234, in run_doc_method
    response = doc.run_method(method)
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/model/document.py", line 861, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/model/document.py", line 1153, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/model/document.py", line 1136, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/frappe/frappe/model/document.py", line 855, in 
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/benches/bench-version-13-2021-08-19/apps/erpnext/erpnext/setup/doctype/email_digest/email_digest.py", line 63, in send
    frappe.set_user(original_user)
NameError: name 'original_user' is not defined
Request Data
{
	"type": "POST",
	"args": {
  "docs": "{\"name\":\"Default Weekly Digest - Technology ERA Company\",\"owner\":\"yalturkmani@teraksa.com\",\"creation\":\"2018-11-26 17:22:26.206951\",\"modified\":\"2020-09-03 00:15:05.078892\",\"modified_by\":\"yalturkmani@teraksa.com\",\"idx\":0,\"docstatus\":0,\"enabled\":1,\"company\":\"Technology ERA Company\",\"frequency\":\"Daily\",\"next_send\":\"27-08-2021 at midnight\",\"income\":1,\"expenses_booked\":1,\"income_year_to_date\":1,\"expense_year_to_date\":1,\"bank_balance\":1,\"credit_balance\":1,\"invoiced_amount\":1,\"payables\":1,\"sales_orders_to_bill\":0,\"purchase_orders_to_bill\":0,\"sales_order\":1,\"purchase_order\":1,\"sales_orders_to_deliver\":0,\"purchase_orders_to_receive\":0,\"sales_invoice\":1,\"purchase_invoice\":1,\"new_quotations\":1,\"pending_quotations\":1,\"issue\":1,\"project\":1,\"purchase_orders_items_overdue\":0,\"calendar_events\":0,\"todo_list\":0,\"notifications\":0,\"add_quote\":0,\"doctype\":\"Email Digest\",\"recipients\":[{\"name\":\"438678712e\",\"owner\":\"Administrator\",\"creation\":\"2021-08-20 20:08:15.084572\",\"modified\":\"2021-08-20 20:08:15.084572\",\"modified_by\":\"Administrator\",\"parent\":\"Default Weekly Digest - Technology ERA Company\",\"parentfield\":\"recipients\",\"parenttype\":\"Email Digest\",\"idx\":1,\"docstatus\":0,\"recipient\":\"yalturkmani@teraksa.com\",\"doctype\":\"Email Digest Recipient\"}],\"__last_sync_on\":\"2021-08-25T21:02:59.418Z\"}",
  "method": "send",
  "args": null
	},
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/run_doc_method"
}

@coveralls
Copy link

coveralls commented Aug 27, 2021

Coverage Status

Coverage remained the same at 51.596% when pulling 3acc5c6 on pateljannat:email-digest-issue into 71b7c63 on frappe:develop.

@pateljannat pateljannat self-assigned this Aug 31, 2021
@pateljannat pateljannat merged commit 48f2e5a into frappe:develop Aug 31, 2021
frappe-pr-bot pushed a commit to frappe-pr-bot/erpnext that referenced this pull request Aug 31, 2021
pateljannat added a commit that referenced this pull request Aug 31, 2021
(cherry picked from commit 48f2e5a)

Co-authored-by: Jannat Patel <31363128+pateljannat@users.noreply.github.com>
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants