Found in the first sales-order test on the live ERPNext (bp-smoketest, SAL-ORD-2026-00006). Staging never showed it, because the ERPNext mock doesn't render Jinja and accepts any date.
1. Sales order webhook never sent
Frappe renders webhook bodies with only {"doc": <document as dict>, "utils": frappe.utils} (webhook.get_context). Two consequences:
doc.items is the dict's items() method, not the order lines. The render failed with TypeError: 'builtin_function_or_method' object is not iterable, and nothing was sent (Webhook Request Log).
The overdue template used frappe.utils.date_diff, but frappe isn't in the context either. It would have failed on the first overdue invoice.
Fix:doc["items"] and utils.date_diff(utils.nowdate(), doc.due_date). Checked: all four templates rendered with Frappe's own render_template and get_context on the live ERPNext against the submitted order, and each result is valid JSON with the expected fields.
2. erpsetup updates outdated webhooks
Before, it only checked whether a webhook existed. Now it compares body and condition and updates in place (same name, URL and secret; the dry run reports would update). Tested with a fake Frappe: no duplicate, one write.
3. Usage Records have been failing since go-live
MariaDB rejects occurred_at = 2026-09-30T06:03:53Z (Error Log: Incorrect datetime value). The client now sends YYYY-MM-DD HH:MM:SS in Europe/Berlin (the ERPNext system time zone; time/tzdata embedded because the image is distroless). The outbox kept retrying, so nothing is lost; the records land once prod runs the fix.
Rollout
ERPNext side (webhooks): after the merge, run erpsetup again from the new image with the admin key. The dry run should show 2× would update. No prod registry change is needed for this.
Registry side (usage): prod promotion with today's hotfix round.
Found in the first sales-order test on the **live** ERPNext (bp-smoketest, `SAL-ORD-2026-00006`). Staging never showed it, because the ERPNext mock doesn't render Jinja and accepts any date.
## 1. Sales order webhook never sent
Frappe renders webhook bodies with only `{"doc": <document as dict>, "utils": frappe.utils}` (`webhook.get_context`). Two consequences:
- `doc.items` is the dict's `items()` method, not the order lines. The render failed with `TypeError: 'builtin_function_or_method' object is not iterable`, and nothing was sent (Webhook Request Log).
- The **overdue** template used `frappe.utils.date_diff`, but `frappe` isn't in the context either. It would have failed on the first overdue invoice.
**Fix:** `doc["items"]` and `utils.date_diff(utils.nowdate(), doc.due_date)`. **Checked:** all four templates rendered with Frappe's own `render_template` and `get_context` on the live ERPNext against the submitted order, and each result is valid JSON with the expected fields.
## 2. `erpsetup` updates outdated webhooks
Before, it only checked whether a webhook existed. Now it compares body and condition and updates in place (same name, URL and secret; the dry run reports `would update`). Tested with a fake Frappe: no duplicate, one write.
## 3. Usage Records have been failing since go-live
MariaDB rejects `occurred_at = 2026-09-30T06:03:53Z` (Error Log: `Incorrect datetime value`). The client now sends `YYYY-MM-DD HH:MM:SS` in **Europe/Berlin** (the ERPNext system time zone; `time/tzdata` embedded because the image is distroless). The outbox kept retrying, so nothing is lost; the records land once prod runs the fix.
## Rollout
- **ERPNext side (webhooks):** after the merge, run `erpsetup` again from the new image with the admin key. The dry run should show 2× `would update`. No prod registry change is needed for this.
- **Registry side (usage):** prod promotion with today's hotfix round.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Found in the first sales-order test on the live ERPNext (the staging mock
renders no Jinja and takes any date):
- Frappe renders webhook bodies with only {doc: <dict>, utils}: doc.items
is the dict's items() method, so the sales-order webhook failed before
it was sent; the overdue template used frappe.utils, which is not there.
Now doc["items"] and utils.date_diff; checked by rendering all four
on the live ERPNext against the submitted order.
- erpsetup updates an existing webhook whose body or condition differs
(in place; dry run reports "would update").
- Usage Record occurred_at is sent as "YYYY-MM-DD HH:MM:SS" in
Europe/Berlin; MariaDB refused RFC 3339, so usage records have not
reached ERPNext since go-live (the outbox kept retrying).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The GoBD Verfahrensdokumentation (§ 9) fixes the outgoing-invoice number
range at RE-JJJJ-NNNN, one range per calendar year for invoices and
returns. ERPNext shipped ACC-SINV-.YYYY.-. erpsetup now makes
RE-.YYYY.-.#### the only and the default Sales Invoice series (Property
Setters) and sets it back if it was changed; the dry run reports
"would update".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found in the first sales-order test on the live ERPNext (bp-smoketest,
SAL-ORD-2026-00006). Staging never showed it, because the ERPNext mock doesn't render Jinja and accepts any date.1. Sales order webhook never sent
Frappe renders webhook bodies with only
{"doc": <document as dict>, "utils": frappe.utils}(webhook.get_context). Two consequences:doc.itemsis the dict'sitems()method, not the order lines. The render failed withTypeError: 'builtin_function_or_method' object is not iterable, and nothing was sent (Webhook Request Log).frappe.utils.date_diff, butfrappeisn't in the context either. It would have failed on the first overdue invoice.Fix:
doc["items"]andutils.date_diff(utils.nowdate(), doc.due_date). Checked: all four templates rendered with Frappe's ownrender_templateandget_contexton the live ERPNext against the submitted order, and each result is valid JSON with the expected fields.2.
erpsetupupdates outdated webhooksBefore, it only checked whether a webhook existed. Now it compares body and condition and updates in place (same name, URL and secret; the dry run reports
would update). Tested with a fake Frappe: no duplicate, one write.3. Usage Records have been failing since go-live
MariaDB rejects
occurred_at = 2026-09-30T06:03:53Z(Error Log:Incorrect datetime value). The client now sendsYYYY-MM-DD HH:MM:SSin Europe/Berlin (the ERPNext system time zone;time/tzdataembedded because the image is distroless). The outbox kept retrying, so nothing is lost; the records land once prod runs the fix.Rollout
erpsetupagain from the new image with the admin key. The dry run should show 2×would update. No prod registry change is needed for this.🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Found in the first sales-order test on the live ERPNext (the staging mock renders no Jinja and takes any date): - Frappe renders webhook bodies with only {doc: <dict>, utils}: doc.items is the dict's items() method, so the sales-order webhook failed before it was sent; the overdue template used frappe.utils, which is not there. Now doc["items"] and utils.date_diff; checked by rendering all four on the live ERPNext against the submitted order. - erpsetup updates an existing webhook whose body or condition differs (in place; dry run reports "would update"). - Usage Record occurred_at is sent as "YYYY-MM-DD HH:MM:SS" in Europe/Berlin; MariaDB refused RFC 3339, so usage records have not reached ERPNext since go-live (the outbox kept retrying). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB