Skip to content

fix(revenue): Accept says an order is created, not a contract (#2752) - #2785

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-2752
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-2752

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Irene · project thread
Fixes #2752
Clause-②: no
Metadata-protocol: none
Metadata-impact: reviewer

维护者速读

  • 用户能看到什么变化:销售在报价单上点「接受」时,确认框不再说「起草一份合同」,改说「生成一张销售订单,需要合同时可在订单上起草」,并注明管理员开启自动起草合同时也会起草合同;接受后的提示说订单已生成、在本报价单的「订单」里可以找到。中、英、西、日四种语言一起改。
  • 为什么做:产品负责人 Irene 在云端 6.6.0 上发现,接受报价后按提示去找合同却找不到——实际只生成了订单,自动起草合同出厂是关闭的。
  • 出错会怎样:只改了提示文字,接受报价实际做的事情完全不变;若措辞不妥,撤回这次改动即可恢复原文字,不影响任何数据。
  • 要你做什么:无。

What changes

  • src/revenue/actions/quote.actions.ts — accept_quote's confirmText and successMessage (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: confirmText binds record (and static params) only, visible binds record and current_user only (@objectstack/spec 18.6.0, ACTION_CONFIRM_TEXT_TEMPLATE_DESCRIBE and ActionSchema.visible), so neither one text with a hole nor two actions with complementary visible can 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. successMessage binds result and record; for an operation: 'update' action result is { operation, object, id, record } with record the quote (probe on a verify stack, below), and the quote holds no link to its order (the order holds the Source Quote). onSuccess navigation is refused beside operation: 'update'. So the toast points to the quote's own Orders list, which the action's refreshAfter redraws 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.ts pins three business facts:

  • the switches the wording describes: quote_accepted_order ships active, quote_accepted_contract_draft ships defaultActive: false — either default moving turns it red before the wording lies;
  • the source: the action's English equals the English pack's word for word, the en text names the order and makes the contract conditional, and each of the four packs carries the confirmation and a toast that renders the quote's name;
  • the toast's claim on a booted verify stack: after accept_quote through 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 verify and the post-merge re-run — see Verification.
  • Timing probe (scratch test, not committed): 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

  • Docs swept in all three docs languages (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.
  • Not covered by the wording: an installation whose administrator switched Accepted Quote Creates an Order off. The ruling defines the order-on states only, and the copy cannot read the switch (above).
  • Platform gap, noted, not filed here: an action's confirmText / successMessage / visible cannot read whether a packaged flow is enabled, and a declarative update's toast cannot reach a record the write's flows created (no result hole for it, no onSuccess beside operation: '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 in en-US and zh-CN:

  • en confirm dialog: "Accept this quote? It is frozen, its opportunity is closed as won and an order is created; if the sale needs a contract, draft it from the order. Where an administrator has switched on automatic contract drafting, a contract is drafted as well." Toast: "Quote Wording EN Quote accepted. Its order has been created: find it under Orders on this quote." The page refreshed with Orders 1 listing the Draft order (SO-0004).
  • zh-CN confirm dialog: 「接受此报价?报价将被冻结,商机关闭为赢单,并生成一张销售订单;需要合同时可在订单上起草。若管理员开启了自动起草合同,还会同时起草一份合同。」 Toast: 「报价单 Wording ZH Quote 已接受,已生成销售订单,可在本报价单的「订单」中查看。」 The 「订单」 list showed the order (SO-0005). No contract was drafted for either.
  • Screenshots: 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 verify at 9eb8d47b (before merging origin/main): validate, typecheck, lint, hygiene and build passed, then Test Files 335 passed (335), Tests 6463 passed | 58 skipped (6521); lock VERDICT command-exit 0. After merging origin/main (#2750, quote-generation lines; no conflict) at 595de1b6: pnpm validate passed, pnpm typecheck passed, and vitest run over quote-accept-copy, quote-lifecycle-actions, i18n-references, flow-quote-lines and flow-quote gave Test 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

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
@vercel

vercel Bot commented Nov 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hotcrm Ignored Ignored Nov 25, 2026 7:30am UTC

Request Review

@github-actions github-actions Bot added ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces backend Server-side behaviour — hooks, flows, actions labels Nov 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:hotcrm#1 · huangyiirene · session_01J8VVAmQQaqVXpJepCqm4Xa

Seat record · ACCEPT · head 595de1b6e0c625a1ebf035f9cb9a0f10a94657aa · 2026-11-25T07:37Z

  • 改了什么:报价「接受」的确认框和成功提示改成说「生成一张销售订单,需要合同可在订单上起草」;管理员开了自动起草合同时会同时起草合同,作为条件写明。四种语言。
  • 为什么改:接受报价的确认框说「并起草一份合同」,实际只生成销售订单、不生成合同(6.6.0) #2752(p1),原文案说会起草合同,实际默认只生成订单。
  • 风险与回滚:只改文案和注释,不动行为;整 PR 回退即可。
  • 要你做什么:无,席位挂自动合并。
  • 席位意见:L1 读过 en、zh-CN 文案(zh-CN 默认句与裁定原文一致)和测试;CI 全绿。

席位核对

  1. Shape: 7 files, +155 / -14; not governed; under the 3000-line threshold.
  2. Ruling fidelity: the default-state sentence matches the card word for word in zh-CN. 「随开关变化」 is met as one sentence true in both states, because on 18.6.0 confirmText binds only record and static params and visible only record/current_user (measured); no workaround built.
  3. Success message: names that the order was created and where to find it (the quote's Orders list, refreshed by refreshAfter); a link is not possible, as an operation: 'update' result carries only the quote and onSuccess is refused beside it (measured). Accepted.
  4. Gate check-runs on head 595de1b6e0c625a1ebf035f9cb9a0f10a94657aa: all 19 success. test/quote-accept-copy.test.ts pins the switch defaults, en action = en pack, four packs carry both keys, and a booted accept leaves 1 order and 0 contracts.
  5. Accepted deviations: 维护者速读 in four lines rather than six; full suite after the main merge left to CI (green).
  6. Out of scope (noted, not filed): action copy cannot read a flow's switch, and a declarative update's toast cannot reach records its flows created; an install with the order flow switched off is outside the ruling's states.
  7. Landing: ready + auto-merge through the merge queue.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 25, 2026 07:38
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit d987554 Nov 25, 2026
20 checks passed
sunhaolin added a commit that referenced this pull request Nov 25, 2026
…n's Done button (#2783)

The manual called the button Submit; the console draws Done (common.done,
「完成」) on that display-only result screen. The Accept confirmation part of
#2783 already landed on main in #2785, whose wording is kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Server-side behaviour — hooks, flows, actions ci/cd CI plumbing and the verification pipeline metadata Declarative metadata — schema, security posture, UI surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

接受报价的确认框说「并起草一份合同」,实际只生成销售订单、不生成合同(6.6.0)

2 participants