Skip to content

Console: read the one lock read, word "closed" apart from "in approval", and save a closing header last (ADR-0162 item 4) #37773

Backlog

Description

@objectstack-fleet

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Filing gate: ③ maintainer-directed · Source: ADR-0162 Execution item 4 (accepted by merge 972114d)

维护者速读

  • 做什么:让记录页、列表和明细表格读统一的锁查询,已关闭的单据上编辑变灰、删除隐藏,并写明原因是「已关闭」。
  • 用户会看到什么:打开一张已关闭的单据,不再看到可以点的编辑和删除;提示写的是「单据已关闭」,不是「审批中请等待」;一次保存里既改明细又把单据关闭时能成功。
  • 不做会怎样:服务端照样会拒绝,但用户要点了保存才知道,而且提示会误说成「等待审批完成」。
  • 顺序:排在统一锁查询那张卡之后。

What happens

The console asks the approvals-family lock read. The grid keeps or drops Delete by lockSource (ui/packages/plugin-grid/src/objectGridActionsColumn.tsx), and the record page reads its lock through ui/packages/app-shell/src/hooks/useRecordApprovals.ts. Neither is told about closed states, so a closed document shows Edit and Delete, and the server's refusal is the user's first notice. Apps work around it with per-object userActions predicates.

The master-detail save writes the header first (ui/packages/plugin-form/src/masterDetailTx.ts). Under ADR-0162 D4 a save that edits lines and closes the document must write the lines first: once the closing write has landed, the next write in the same unit of work meets a closed record.

Expected

  • The record page, the grid and the line grid ask the one lock read (item 2) and word the reason from lockReason: "in approval" and "closed" are different things to tell a user.
  • On a locked record Edit is greyed. Delete is hidden where the read says closed_state, for either lockSource. Under approval the published rule stays: a record held on its own keeps Delete, a line of a held master does not.
  • No per-object predicate is needed for it. userActions predicates stay display only and unchanged.
  • The master-detail save orders a closing header write last, after its line writes.
  • An action button stays as the app declares it: the lock read does not hide an action. An app's own "Reopen", "Void" or "Refund" action is how a closed document is changed.
  • Strings in every locale the console carries.

Done when

  • A closed record: Edit greyed with the closed wording, Delete hidden, on the record page, in the grid and in the line grid of its master.
  • A record held by an approval: unchanged from today, including Delete by lockSource.
  • A record that is both closed and held reads as closed.
  • A reader who may not see the state field still gets the closed wording, and the page shows neither the field nor its value.
  • One save that edits lines and sets the closing state lands whole. A test pins the write order.
  • No console code path asks the approvals-family lock read for the edit and delete affordances. The record page's approvals panel keeps its own lock.
  • Browser-verified on the showcase's paid invoice (after item 3) or a fixture app, with screenshots in the PR.

Category ③: maintainer-directed. A build card of ADR-0162, child of #36253.
Grade: area:data · Feature · n/a (not a defect) · reach: every console user of a declaring app · evidence: read (the two askers on main at 972114df)
Suggested-grade: p2 · part of the feature #36253; without it the refusal is the user's first notice
Size: M (three console surfaces, one save path, their strings and tests).
Business reason: carried from #36253. A hidden button and a refused write should say the same thing, without each app spelling it out per object.
Reader: seat 2 (repo:objectstack#2), a card thread on ui/**, effort high.
Blocked-by: #37770 (item 2) (the read this card asks). The save-order change does not wait and can go first if the seat splits it out.
Clause-②: no. Console behaviour; no published contract moves.
Metadata-protocol: none
Dedupe: searched getRecordLock (open issues): #37195 concerns the record page's approvals part, which this card leaves as it is.
Related: #36253, PR #37606 (ADR-0162), #37231 and #37151 (the lockSource work the grid reads today), #37195.

Activity

  1. added
    priority:p2
    pm:blocked
    domain:ui
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:data · domain:ui · Feature · priority:p2 · pm:blocked · size M; rationale: closedStates. The console reads the one lock read, tells "closed" apart from "in approval", and saves a closing header last. Part of #36253; p2. It keeps its named blocker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:uipm:blockedpriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions