Repository navigation
fix(revenue): Accept says an order is created, not a contract (#2752) - #2785
Merged
Merged
Conversation
The accept_quote confirmation still said a contract is drafted, while since #2558 an accepted quote creates an order and the automatic contract draft ships switched off. The confirmation and toast now say what the shipped switches do, in all four packs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmQQaqVXpJepCqm4Xa
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAmQQaqVXpJepCqm4Xa
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Author
|
repo:hotcrm#1 · huangyiirene · session_01J8VVAmQQaqVXpJepCqm4Xa Seat record · ACCEPT · head
席位核对
|
This was referenced Nov 25, 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.
Requested by Irene · project thread
Fixes #2752
Clause-②: no
Metadata-protocol: none
Metadata-impact: reviewer
维护者速读
What changes
src/revenue/actions/quote.actions.ts—accept_quote'sconfirmTextandsuccessMessage(en source), plus the header comment that still said acceptance drafts a contract.src/revenue/translations/{en,zh-CN,es-ES,ja-JP}.ts— the same two keys in all four packs. zh-CN uses the product owner's ruled sentence for the default state verbatim (「接受此报价?报价将被冻结,商机关闭为赢单,并生成一张销售订单;需要合同时可在订单上起草。」) and adds the switched-on case as a condition.test/quote-accept-copy.test.ts— new..changeset/2752-accept-quote-says-order.md.Why the text does not switch with the flow (measured on 18.6.0). The ruling asks for the wording to follow the switch. An action's copy cannot read whether a flow is on:
confirmTextbindsrecord(and staticparams) only,visiblebindsrecordandcurrent_useronly (@objectstack/spec18.6.0,ACTION_CONFIRM_TEXT_TEMPLATE_DESCRIBEandActionSchema.visible), so neither one text with a hole nor two actions with complementaryvisiblecan follow the activation ledger. The confirmation therefore states the shipped default and names the switched-on contract draft as a condition, a sentence that is true in both states. No workaround was built.Why the toast names no order number.
successMessagebindsresultandrecord; for anoperation: 'update'actionresultis{ operation, object, id, record }withrecordthe quote (probe on a verify stack, below), and the quote holds no link to its order (the order holds the Source Quote).onSuccessnavigation is refused besideoperation: 'update'. So the toast points to the quote's own Orders list, which the action'srefreshAfterredraws with the order in it, with its link. The order is created inside the accepting write, before the action answers (measured, and pinned below), so "has been created" is true when the toast shows.First files to read (risk order):
src/revenue/translations/zh-CN.ts(the ruled sentence) ·src/revenue/actions/quote.actions.ts(the en source and the header comment) ·test/quote-accept-copy.test.ts.Tests
test/quote-accept-copy.test.tspins three business facts:quote_accepted_orderships active,quote_accepted_contract_draftshipsdefaultActive: false— either default moving turns it red before the wording lies;accept_quotethrough the action door, the order row exists with no wait, and with the shipped switches no contract is drafted.Local runs
vitest run test/quote-accept-copy.test.ts test/quote-lifecycle-actions.test.ts test/i18n-references.test.ts—Test Files 3 passed (3),Tests 56 passed (56), lock VERDICT command-exit 0.pnpm verifyand the post-merge re-run — see Verification.verify.actions.run('crm_quote','accept_quote',…)answered{"operation":"update","object":"crm_quote","id":…,"record":{…"status":"accepted"…}}; orders with that Source Quote read immediately after: 1 (SO-0004); contracts: 0.Acceptance notes
content/docs/**en, zh-Hans, zh-Hant) and the in-app pages (src/docs/,src/revenue/docs/, en + zh): no page still says accepting a quote drafts a contract as current behaviour — Sales order, step B2: an accepted quote creates an order; the contract is drafted from the order on demand; both automations are admin-switchable flows #2558 already rewrote them (Quotes, Orders, Automation, Sales index, Introduction, scenarios, FAQ). Only past-tense "before this release" sentences and the switch descriptions mention it, and they are true. No doc edit was needed.confirmText/successMessage/visiblecannot read whether a packaged flow is enabled, and a declarative update's toast cannot reach a record the write's flows created (noresulthole for it, noonSuccessbesideoperation: 'update'). That is a capability request for objectstack, not a defect.Verification
Browser, dev boot of this branch (
objectstack dev, 18.6.0, admin), on two fresh presented quotes with a signed copy, Chromium inen-USandzh-CN:SO-0004).SO-0005). No contract was drafted for either.accept-quote-wording-2752/in the project files (not committed).Two-minute check: on a dev boot, open any Presented quote that has a Signed Copy and click Accept — the dialog names an order, not a contract; confirm, and the toast says the order was created while the quote's Orders list shows it.
pnpm verifyat9eb8d47b(before mergingorigin/main): validate, typecheck, lint, hygiene and build passed, thenTest Files 335 passed (335),Tests 6463 passed | 58 skipped (6521); lock VERDICT command-exit 0. After mergingorigin/main(#2750, quote-generation lines; no conflict) at595de1b6:pnpm validatepassed,pnpm typecheckpassed, andvitest runoverquote-accept-copy,quote-lifecycle-actions,i18n-references,flow-quote-linesandflow-quotegaveTest Files 5 passed (5),Tests 90 passed (90), VERDICT command-exit 0. The full suite on the merged head is CI's.🤖 Generated with Claude Code