fix(forecast): drop the column total on the formula field expected_amount - #1986
Merged
objectstack-fleet[bot] merged 1 commit intoOct 2, 2026
Merged
Conversation
…ount The all_forecasts grid summed expected_amount, a formula field. The spec's AGGREGATE_FIELD_TYPE_COMPATIBILITY sum row admits number, currency, rating, slider, progress, summary, boolean and toggle, not formula: a formula has no stored column to aggregate. The column stays; Closed Won and Commit keep their totals, which add up to the expected figure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ER8ntXZhYebyQ66aXWdjfT
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1980
What
The All Forecasts grid (
all_forecastsoncrm_forecast) asked for a column total (summary: 'sum') on Expected (expected_amount). That field is aformula: Closed Won + Commit, computed per row. A formula has no stored column to aggregate, so the spec's aggregate compatibility table refusessumon it.This PR follows the maintainer's ruling on the card (「p3 bug · 去掉该列合计(推荐)」). It deletes only the
summarykey on that column and adds a one-line comment saying why. The column stays, and so do the totals on Quota, Closed Won, Commit, Best Case and Pipeline. A reader can still get the expected figure as Closed Won total + Commit total. It adds no stored field, no writer and no platform change.Files:
src/sales/views/forecast.view.ts(one key removed, one comment line), and.changeset/1980-forecast-formula-summary.md('hotcrm': patch, since a total disappears from a list view).The premise, re-measured on
origin/maincf422b83Main moved from the dispatch base
39ba05e2tocf422b83(#1985, which touchessrc/sales/flows/forecast-snapshot.flow.ts, not this file). The premise still holds on the new head.src/sales/views/forecast.view.ts:28read{ field: 'expected_amount', width: 140, align: 'right', summary: 'sum' }.src/sales/objects/forecast.object.ts:177declaresexpected_amount: Field.formula({ ... }).@objectstack/spec17.6.0,dist/data/index.mjs, hasAGGREGATE_FIELD_TYPE_COMPATIBILITY. Itssumrow is[...ADDITIVE_AGGREGATE_FIELD_TYPES, ...BOOLEAN_AGGREGATE_FIELD_TYPES], which reads at runtime as["number","currency","rating","slider","progress","summary","boolean","toggle"].formulais not in it, and neither ispercent.dist/ui/index.mjscarriescompileListViewGroupQuery. It compiles each columnsummaryof a grouped list view into a server-side group-header aggregation node, andsummaps to functionsum.all_forecastsis grouped byperiod_label. I did not measure whether today's renderer issues that query (see Acceptance notes).Class sweep: every column
summaryin every registered viewInstrument. A one-off tsx script, not committed. It imports
allViewsandallObjectsfromobjectstack.composition.ts, walkslistand everylistViewsentry, reads each summarised field's declaredtype, and maps the summary member to its aggregation function, usingCOLUMN_SUMMARY_AGGREGATIONcopied from the installeddist/ui/index.mjs. It then judges the pair with the spec's ownisAggregateCompatibleWithFieldType. It walked 14 view sets and found 20 summary sites, the same count asgit grep -n "summary:" -- 'src/*/views/*.view.ts'(20 lines: 18sum, 2avg).Positive control. The known pair
crm_forecast:all_forecasts expected_amount sum x formulareadsREFUSED.Result before the fix: 1 refused pair out of 20. After: 0 refused out of 19.
No other site is in this defect class, so no other view file is edited.
src/sales/views/opportunity.view.ts, which #1950 holds, has no refused pair: bothexpected_revenuecolumns arecurrency. A grep forsummary:outsideviews/returns 10 hits. None is a column summary: they are activity-feed text inopportunity.object.tsandcase.object.ts, an action body incontact.actions.ts, and seed rows inservice.seed.ts.Tests that pin these summaries: none. A grep of
test/forsummary,expected_amountandall_forecastsfinds no view-snapshot test and no summary roster. The docs promise no total on Expected either:content/docs/sales/forecasting*.mdxdescribe it as a derived per-row formula.Verification
All at HEAD
3cba8f5f, the commitpnpm verifyran on:OS_VERIFY_LOCK_SLOT=hotcrm-issue-1980 bash .../os-verify-lock.sh -c 'pnpm verify'readsos-verify-lock: VERDICT command-exit 0 · held the lock 169s (2m49s) · waited 0s.1 warning(s), 16 suggestion(s).✓ i18n lint gate: 0 i18n/missing-* issues.✓ source hygiene clean.✓ source token ratchet clean.Artifact: dist/objectstack.json.Test Files 174 passed (174)·Tests 3728 passed | 1 skipped (3729).Token ratchet (
pnpm hygiene:tokens). The comment line costs 0 tokens, since the ratchet counts comment-stripped source.cf422b833cba8f5fThe other three packages are untouched.
Acceptance notes
src/salesinteraction-layer ceiling from ~31,000 to ~30,000. That file is outside this card's claimed surface, and a sibling card shares the container. Carrier: none.compileListViewGroupQueryon 17.6.0. If it does, the oldsum_expected_amountnode would have been refused server-side rather than rendered as a client footer. Either way the fix is the same, and this PR removes that node.os validate --strictflags from the{…}template dialect to CEL envelopes, with tests #1984'ssrc/sales/flows/forecast-snapshot.flow.ts.Co-Authored-Bytrailer names a model. The dispatch contract asks for model-free trailers, and history is not rewritten for it. The squash-merge message can drop that line.Generated by Claude Code