Simplify: O2M batch, domain dedup, db.go split, constants
Performance: - O2M formatO2MFields: N+1 → single batched query per O2M field (collect parent IDs, WHERE inverse IN (...), group by parent) Code dedup: - domain.go compileSimpleCondition: 80 lines → 12 lines by delegating to compileQualifiedCondition (eliminates duplicate operator handling) - db.go SeedWithSetup: 170-line monolith → 5 focused sub-functions (seedCurrencyAndCountry, seedCompanyAndAdmin, seedJournalsAndSequences, seedChartOfAccounts, resetSequences) Quality: - Magic numbers (80, 200, 8) replaced with named constants - Net -34 lines Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -575,7 +575,7 @@ func (s *Server) dispatchORM(env *orm.Environment, params CallKWParams) (interfa
|
||||
}
|
||||
}
|
||||
|
||||
limit := 8
|
||||
limit := defaultNameSearchLimit
|
||||
if v, ok := params.KW["limit"].(float64); ok {
|
||||
limit = int(v)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user