fix(invoiceintake): ToDos are assigned by the intake user #83

Merged
sharang merged 2 commits from fix/intake-todo-assigned-by into main 2026-10-20 09:01:46 +00:00
Owner

The first live run (one forwarded test mail) failed with create ToDo: HTTP 403 PermissionError ("Nicht erlaubt über Controller-Berechtigungsprüfung").

Cause: in Frappe 15.112.0 (installed), todo.has_permission grants a user without System Manager only ToDos where allocated_to or assigned_by is that user; the owner clause exists only in later v15 releases. The service assigned to the finance user and left assigned_by empty.

Fix: ask frappe.auth.get_logged_user once and set it as assigned_by. That is also the honest record ("assigned by Rechnungseingang"), and it keeps the service's own ToDos visible to it, which matters because they are how it remembers which mails it has already handled. The test fake now enforces the 15.112 rule.

Checked as well: File listing for the service user works on 15.112 (a System User sees files attached to any doctype it can read; Communication via Inbox User).

🤖 Generated with Claude Code

The first live run (one forwarded test mail) failed with `create ToDo: HTTP 403 PermissionError` ("Nicht erlaubt über Controller-Berechtigungsprüfung"). Cause: in Frappe **15.112.0** (installed), `todo.has_permission` grants a user without System Manager only ToDos where `allocated_to` or `assigned_by` is that user; the `owner` clause exists only in later v15 releases. The service assigned to the finance user and left `assigned_by` empty. Fix: ask `frappe.auth.get_logged_user` once and set it as `assigned_by`. That is also the honest record ("assigned by Rechnungseingang"), and it keeps the service's own ToDos visible to it, which matters because they are how it remembers which mails it has already handled. The test fake now enforces the 15.112 rule. Checked as well: File listing for the service user works on 15.112 (a System User sees files attached to any doctype it can read; Communication via Inbox User). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-10-20 08:34:04 +00:00
fix(invoiceintake): ToDos are assigned by the intake user
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 25m30s
ci / image (pull_request) Skipped
e96bd39e21
Frappe 15.112 lets a user without System Manager create a ToDo only when
it is assigned to or by that user (the owner clause came later), so the
first live run got 403 on its first ToDo. The service now asks ERPNext
for its own user once and sets it as assigned_by.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang added 1 commit 2026-10-20 08:35:36 +00:00
fix(invoiceintake): forwarded invoices get an enter-by-hand ToDo
ci / shared (pull_request) Successful in 14s
ci / test (pull_request) Successful in 25m38s
ci / image (pull_request) Skipped
3d093f84af
A mail from our own domain or a freemail address no supplier has was
forwarded by a person; no supplier record can match it, so the ToDo now
says to enter the invoice by hand instead of suggesting a retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sharang merged commit 8600c92e96 into main 2026-10-20 09:01:46 +00:00
Sign in to join this conversation.