Repository navigation
fix(lead): stop requiring an owner pick on the New Lead form - #2099
Merged
objectstack-fleet[bot] merged 5 commits intoOct 14, 2026
Merged
Conversation
The create form marked owner_id required, so the console refused the save with "Lead Owner is required" before the platform's insert-time stamp could make the creator the owner. Keep the field on the form so a manager can still pick another owner, as the Opportunity, Account and Contact New forms already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8mZuzuyZAHSrgQKmv6ASv
Also drops objectstack.config.bundled_4tw0mek20uf.mjs, a dev-server compile artifact the previous commit picked up by accident. Claude-Session: https://claude.ai/code/session_01P8mZuzuyZAHSrgQKmv6ASv Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8mZuzuyZAHSrgQKmv6ASv Co-authored-by: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Oct 14, 2026
The owner_id comment on the New Lead form claimed a manager can still choose another owner. Measured on 18.0.0-next.0, the console drops a picked owner on create (objectui#12359); the comment now says so. Claude-Session: https://claude.ai/code/session_01P8mZuzuyZAHSrgQKmv6ASv Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8mZuzuyZAHSrgQKmv6ASv Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2097
Clause-②: no
What changed
src/sales/views/lead.view.ts: in the create form (LeadViews.form, which is the New Lead dialog), theowner_identry no longer hasrequired: true. The field is still on the form, now as a bare'owner_id', with a comment explaining why. The Opportunity, Account and Contact New forms already leave it optional.test/ownership-model.test.ts: one new test next to "nothing in the schema fillsowner_id". It checks that the New Lead form hasowner_idand does not mark it required. The server side (a rep's insert with no owner is saved under the rep, even when round-robin would pick another rep) is already covered end to end bystands down when the middleware already stamped an ownerin the same file..changeset/2097-lead-owner-not-required.md(patch).Why
As
na.rep, Console → Leads → New: clicking Create stopped at "Lead Owner is required" and nothing was sent. The platform already sets the creator as owner when an insert has noowner_id, butrequiredon the form blocked the save in the browser before that could happen.Measurements
Console on port 4102,
@objectstack/*18.0.0-next.0, demo org frompnpm demo:staff. Checked with DOM and network probes in Playwright, then the row read back over REST.2f3d898d(required)Lead Owner*, inline errorLead Owner is required, 0 writes tocrm_leadowner_idkey, savedowner_id= na.repowner_id= na.rep. This run tells the two mechanisms apart: thesales_reppool is [na.rep, eu.rep] with 1 and 0 open leads, so round-robin would have picked eu.repowner_id= the managerowner_id, and savedowner_id= the manager2f3d898d(required)owner_idsent, saved under the managercrm_lead.owner_idisField.lookup('sys_user', { system: true, readonly: false })and is not required. Novalidations[]entry orrequiredWhenmentions it. The form entry was the only thing blocking the save: once it is removed, the same rep's save goes through.required: truecame in with344c5f57, "Reset hotcrm to framework/app-crm baseline" (2026-05-22), on what was then theownerfield.9f748ab5(Ownership model mismatch: app-authoredownerlookups vs the platform'sowner_id— reassigning Owner in the UI does not move record access #548, landed as fix: bug 批次修复(PM 派发循环)— #606 #673 #610 #548 #678 #650 已落地 #677) renamedownertoowner_idand kept the flag unchanged. That commit's own message says the security middleware sets the acting user as owner on any insert that leavesowner_idempty. No ruling or card asked for the flag, so the card's stop line does not apply.Acceptance notes
plugin-form(ModalForm.tsxcallssanitizeFormData) removesowner_idfrom every create payload. Only the edit path adds back a changed owner (objectui#12205). This is an existing platform issue that this PR does not change. It has been reported to the seat for an upstream card and is not worked around here (AGENTS.md §2). Reading the code, every New form that showsowner_idis affected the same way. Only the Lead form was measured.formViews.advanced_conditional(a showcase form, not the create dialog) also requiresowner_idwhen status is contacted or qualified. It is outside this card's file surface and is only noted here.content/docs/**/leads*.mdxsays a new lead needs an owner picked, so the docs are unchanged.6b5c8121accidentally picked up a temporary file from the dev server (objectstack.config.bundled_4tw0mek20uf.mjs).b5237b67removes it, so the net diff has 3 files.6b5c8121also has a harness-attributionCo-Authored-Bytrailer that names the model. It was not rewritten.Reverse check (one-time, no permanent test)
node scripts/ablation-replace.mjs(objectstack) put back{ field: 'owner_id', required: true }in place of'owner_id'. The anchor matched once, and the file's blob changed from049bedbeto251dc02d. Before the run I predicted the new test would fail. Result:Tests 1 failed | 15 passed (16),AssertionError: the New Lead form demands an owner again: expected true to be false. The file was then restored and its blob matches HEAD (049bedbe), with an emptygit diff HEAD. Without the mutation:Tests 16 passed (16). The test importssrc/directly, sodist/plays no part.Gates (all on
ca836d0d)pnpm validate:✓ Validation passed, exit 0pnpm typecheck: exit 0 (--listFilesincludes both edited.tsfiles)pnpm lint:18 suggestion(s), exit 0pnpm lint:i18n-gate:✓ i18n lint gate: 0 i18n/missing-* issues, exit 0pnpm hygiene:✓ source hygiene clean, exit 0pnpm hygiene:tokens:✓ source token ratchet clean, exit 0pnpm build:✓ Build complete, exit 0pnpm test:Test Files 179 passed (179),Tests 3660 passed | 1 skipped (3661), exit 0Playwright e2e is left to CI.
Generated by Claude Code