Skip to content

zh-CN org: the contract drafted from an accepted quote and the renewal deal opened by the sweep carry English text ("Auto-drafted from accepted quote …", "Renewal — <number>", "Confirm renewal terms with customer") #2535

Closed

Description

@sunhaolin

Found while walking a zh-CN user through contract renewal on a hosted tenant (2026-11-16), then checked against main at 3617fbdf. Same class as #2494 (English escalation reasons) and #2522 (English subjects on automatic tasks), on records those two do not list: the opportunity and the contract that HotCRM creates by itself. Filed separately because #2522's table is tasks only. Fold it into #2522 if that is tidier.

What a customer sees. A zh-CN rep accepts a quote. A contract is drafted for them, and its 描述 reads:

Auto-drafted from accepted quote QTE-0007 - 演示公司 Demo Co – 2026-11-16

A year later the renewal sweep opens a deal in their pipeline named Renewal — CTR-0005, with 下一步 set to Confirm renewal terms with customer. The rep wrote none of it, and on each page it is the only English sentence.

Where.

Trigger Text written Field Source
Quote accepted Auto-drafted from accepted quote <quote label> / Auto-drafted from an accepted quote crm_contract.description src/revenue/objects/quote.hook.ts:641
Contract enters its notice window with Auto Renewal on Renewal — <contract number> crm_opportunity.name src/sales/flows/contract-renewal.flow.ts:160
same Confirm renewal terms with customer crm_opportunity.next_step src/sales/flows/contract-renewal.flow.ts:170

Observed live for the first row, on a contract drafted from an accepted quote. The two renewal rows are read from the code, not reproduced: no contract on that tenant is inside its notice window and the sweep cannot be run by hand. Neither string has an entry in any locale pack.

Two things a fix has to keep.

  • src/sales/flows/contract-drafted-notice.flow.ts:50 decides whether to notify the owner by record.description.startsWith('Auto-drafted from') (AUTO_DRAFTED_PREFIX, line 14). A description that varies by locale silences that notice unless the gate stops reading the prose. A drafted contract has no link back to the quote that produced it — its only provenance is a free-text sentence #1253 already asked for a real link from a drafted contract back to its quote.
  • The renewal sweep finds an existing renewal deal by type: 'existing_renewal' and stage, not by name (contract-renewal.flow.ts:140-146), so the name is free to change. test/flow-scheduled.test.ts:635 pins the English name and moves with it.

Fix shape. Same as #2494 and #2522: write the text in the organization's language from a per-locale text map covering the four locale packs, once a hook and a flow can read the org's locale. #2522's triage names that seam as objectstack#34062, so this issue waits behind the same block and can ship in the same PR. No hard-coded Chinese.

Done when: in a zh-CN org the drafted contract's description, the renewal deal's name and its next step are Chinese; an en org still reads English; the contract-drafted notice still fires exactly once for a drafted contract; and the sweep still opens only one renewal deal per account.

Activity

  1. added
    bug
    on Nov 16, 2026
  2. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g

    Triage: on hold · p1 class · first touch · 2026-11-18T05:26Z

    ⛔ Not a claim.

    Restart-when: hotcrm main pins an @objectstack/* release that contains objectstack 0e2e4f5688 (objectstack-ai/objectstack#34438) · Restart-grade: p1


    Generated by Claude Code

  3. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g

    Restarted · pm:queue · p1 restored · 2026-11-18T10:27Z

    The hold condition is met: hotcrm main 245489e1 pins @objectstack/* 18.6.0, which contains objectstack 0e2e4f5688 (objectstack#34438). The #2634 dev's probe on 18.6.0 reads this card's mechanism as delivered. pm:on-hold → pm:queue. The grade returns to Restart-grade: p1.


    Generated by Claude Code

  4. added
    pm:queue
    priority:p1
    and removed on Nov 18, 2026
  5. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g

    Claim: PM loop round 1
    Session: session_01ASNY8XiE8ZJYbrmzFDtS9g
    Account: os-mickey
    Branch: claude/issue-2494-org-locale-stored-text (one family PR for #2494, #2522 and #2535, named by the chain head)
    Worktree: hotcrm-issue-2494
    Domain: repo:hotcrm (single-lane repo, no domain:*)
    Seat: repo:hotcrm#2
    File surface: the hooks, flows and action that write the English literals named on #2494, #2522 and #2535 (src/service/objects/case.hook.ts, src/sales/objects/opportunity.hook.ts, src/sales/objects/lead.hook.ts, src/revenue/objects/quote.hook.ts, src/sales/flows/contract-renewal.flow.ts, src/sales/flows/contract-drafted-notice.flow.ts, and any further site the cards list); their locale packs under src/*/translations/ (four locales); tests under test/; .changeset/2494-*.md (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: TIER_DEFAULT, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: HotCRM's own hooks and flows in objectstack-ai/hotcrm | the platform path is objectstack#34062 (the flow half) and objectstack#34374 (the hook half, PR objectstack#34545); the dev confirms which halves 18.6.0 carries | every user of a zh-CN organization who reads an automatic task, escalation, contract or renewal deal; in use today
    Thread-read: 6975835981
    Premise: holds (the #2634 dev's probe on 18.6.0 reads #2494, #2522 and #2535 as delivered)
    Serial constraints cleared: fold of three cards: same defect (stored text written in English), same fix (a per-locale text map read at the write), one PR, each independently checkable on its own card's done-when. Not folded: #2582, the action half, which is not in 18.6.0 (4ffe9d314a, objectstack#35085). Seat 1's PR #2583 touches src/o2c/translations/*; if this PR needs an o2c pack, merge main after #2583 lands rather than edit the same lines.

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 18, 2026
  7. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g

    ACCEPT → PR #2652 comment 6980397773 · 2026-11-18T13:47Z


    Generated by Claude Code

  8. objectstack-fleet commented on Nov 18, 2026

    @objectstack-fleet
    Contributor

    repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g

    Merged · 2026-11-18T14:44Z · PR #2652 merged through the queue (09077c7). Fixes #2535 closed this card, and pm:dispatched is cleared in this stroke.

    Delivered: the drafted contract's description, and the renewal deal's name and next step, are written in the organization's language. The drafted-contract notice fires on crm_contract.automation_key = quote_acceptance instead of the English prefix.


    Generated by Claude Code

  9. removed
    pm:dispatched
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpriority:p1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions