Skip to content

fix(templates): a create-only calculated action no longer renders the field read-only - #6698

Merged
delchev merged 1 commit into
masterfrom
fix/ui-create-default-fields-stay-editable
Aug 13, 2026
Merged

fix(templates): a create-only calculated action no longer renders the field read-only#6698
delchev merged 1 commit into
masterfrom
fix/ui-create-default-fields-stay-editable

Conversation

@delchev

@delchev delchev commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Closes #6696.

isCalculatedProperty drove a hard disabled on the generated inputs. That is right for a DERIVED field (Balance recomputes on every write) but wrong for a field whose only calculated aspect is calculatedActionOnCreate — that is a server-side DEFAULT (Due from the customer's terms, Currency from the company, a document's tax event date, its bank account). The documented contract for those is "pre-filled AND editable — a value you pick is respected", and the actions implement exactly that (a non-null incoming value always wins); the REST layer honored a user value the form could no longer produce. Concretely: wiring a currency default (#6687) made the Currency picker un-editable — an invoice in another currency could no longer be created from the form.

Read-only now means DERIVED: an expression (create or update) or an update-time recompute action. A field that must stay locked despite a create-only action says readOnly: true explicitly — kept working, and it also enrolls the field in the generated update()'s system-owned preservation (#6689).

Emission sites: document/document-view.html.template, manage/form-view.html.template, master/detail-register.js.template.

Verified end-to-end on a local instance against the BusinessIntents suite: after regen, the defaulted Currency / Bank Account / Tax Event Date / Due inputs render :disabled="isPreview" (editable on create/edit), derived fields stay locked, and a REST create with no picks lands the defaults while explicit picks are respected.

🤖 Generated with Claude Code

… field read-only

isCalculatedProperty drove a hard `disabled` on the generated inputs, which is right
for a DERIVED field (Balance recomputes on every write) but wrong for a field whose
only calculated aspect is calculatedActionOnCreate - that is a server-side DEFAULT
(Due from the customer's terms, Currency from the company, a document's tax event
date, its bank account). The documented contract for those is "pre-filled AND
editable - a value you pick is respected", and the actions implement exactly that
(a non-null incoming value always wins); the REST layer honored a user value the
form could no longer produce. Concretely: wiring the currency default (#6687) made
the Currency picker un-editable - an invoice in another currency could no longer be
created from the form.

Read-only now means DERIVED: an expression (create or update) or an update-time
recompute action. A field that must stay locked despite a create-only action says
readOnly: true explicitly (kept working, and now also enrolls the field in the
generated update()'s system-owned preservation).

Emission sites: document-view.html.template, manage/form-view.html.template,
master/detail-register.js.template. Closes #6696.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@delchev
delchev merged commit 1b4c374 into master Aug 13, 2026
10 checks passed
@delchev
delchev deleted the fix/ui-create-default-fields-stay-editable branch August 13, 2026 06:53
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.

A create-only calculated action must not render the field read-only - it is a default, not a derivation

1 participant