Skip to content

fix(core): bank account and change request create forms were fully read-only - #20

Merged
marchtian merged 1 commit into
mainfrom
claude/project-thread-r6vi3b
Oct 24, 2026
Merged

marchtian merged 1 commit into
mainfrom
claude/project-thread-r6vi3b

Conversation

@marchtian

Copy link
Copy Markdown
Collaborator

Requested by 田騏 · project thread

改了什么

v0.2 浏览器验收发现:控制台里「新建银行账户」和「新建信息变更单」的表单所有锁定字段都显示为只读,填不了。原因是界面按字段默认值(状态「待核验」/「审批中」、审批结论为空)计算 readonlyWhen,而服务端新建时不看 readonlyWhen(平台问题 objectstack#25584)。

  • 银行账户的 locked、变更单的 created / proposal 三条谓词前加 has(record.id) && record.id != null,只对已保存的记录生效。临时绕法,代码里注明了平台 issue。
  • 变更单的「基本信息 / 地址 / 银行账户 / 联系人」四个分组按变更类型显示,基本信息变更单的详情页不再出现带默认币种的「银行账户变更」分组。

怎么验证的

  • pnpm verify 全部通过,82 个测试通过(包括「待核验账户保持锁定」「审批中变更单不能改」这类服务端锁定测试,说明更新时的锁没有放松)。
  • 本地浏览器实测:品类经理在界面上新建银行账户、发起银行账户变更单;采购员发起基本信息变更单;两级审批通过后写回档案。截图在项目文件 hotsrm-v02-screenshots/。

Generated by Claude Code

…ad-only

Browser test of v0.2 found that the console create forms for srm_supplier_bank_account
and srm_supplier_change_request rendered every locked field as read-only: the form
evaluates readonlyWhen against the field defaults (status pending_verify / in_review,
approval_status empty), while the server exempts INSERT from readonlyWhen
(objectstack#25584). Category managers could not add a bank account and buyers could
not raise a change request in the UI.

- Guard the three lock predicates with has(record.id) so they only apply to saved
  records; the stored row on update carries id, so server-side locks are unchanged
  (all 82 tests pass, including the pending-account and in-review lock tests).
- Show the basic / address / bank / contact groups only for the chosen change type,
  so a basic-info change no longer shows a bank section with the defaulted currency.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApdH2PdG6SVQqxeEgmRP9U
@marchtian marchtian self-assigned this Oct 24, 2026
@marchtian
marchtian merged commit 19cac8d into main Oct 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants