Merged
Conversation
added 10 commits
December 16, 2025 09:51
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for field calculation events on BOM (Bill of Materials) items, enabling custom field calculations when BOM items are created, modified, copied, or indexed. The implementation includes extensive custom attribute support (120 custom fields across char, bigchar, integer, float, boolean, and date types) to allow users to perform calculations on BOM item data.
- Introduces a new
BOMItemFieldCalculationEventthat follows the same pattern as the existingPartFieldCalculationEvent - Adds 120 custom attribute fields to the
BOMItemclass (20 fields each for char, bigchar, integer, float, boolean, and date types) - Updates the
get_items_of_typeutility function to support finding single object instances in addition to lists
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| json_schemas/request.json | Adds JSON schema definitions for BOMItem with all standard and custom fields, BOMItemFieldCalculationData, and BOMItemFieldCalculationEvent; updates event discriminator mapping |
| csfunctions/objects/part.py | Extends BOMItem class with cdb_object_id field, 120 custom attribute fields, part reference field, and link_objects method for establishing object relationships |
| csfunctions/events/bom_item_field_calculation.py | Defines new BOMItemFieldCalculationEvent and BOMItemFieldCalculationData classes following established event patterns |
| csfunctions/events/base.py | Adds BOM_ITEM_FIELD_CALCULATION to EventNames enum |
| csfunctions/events/init.py | Exports new BOMItemFieldCalculationEvent and BOMItemFieldCalculationData classes and includes them in event type unions |
| csfunctions/util.py | Enhances get_items_of_type function to handle single object instances in addition to lists, required for BOMItem's link_objects method |
| docs/reference/objects.md | Documents all 120 new custom attribute fields and the part reference field added to BOMItem |
| docs/reference/events.md | Documents the new BOMItemFieldCalculationEvent with its data structure, action types, and field descriptions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
conlwi
approved these changes
Jan 8, 2026
albertsj
approved these changes
Jan 8, 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.
Adds event for field calculation on BOM Items.
Also adds missing custom attributes on BOM Items, because those are the attributes you would usually want to do calculations on.