Fix portal user linking: use updateResource instead of set_value for child table
set_value doesn't work for child tables like portal_users. Use updateResource (PUT /api/resource/Customer) which handles it correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
02d2415d7a
commit
28b407eea6
1 changed files with 2 additions and 5 deletions
|
|
@ -1225,11 +1225,8 @@ export async function handlePaymentComplete(
|
|||
erpCustomer = custResult.customerName;
|
||||
// Link portal user to Customer so portal shows their orders
|
||||
try {
|
||||
await callMethod("frappe.client.set_value", {
|
||||
doctype: "Customer",
|
||||
name: erpCustomer,
|
||||
fieldname: "portal_users",
|
||||
value: [{ user: custEmail }],
|
||||
await updateResource("Customer", erpCustomer!, {
|
||||
portal_users: [{ user: custEmail }],
|
||||
});
|
||||
} catch { /* non-fatal — may already be linked */ }
|
||||
} catch { /* non-fatal */ }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue