Skip to content

Conversation

@jens-kuerten
Copy link
Collaborator

@jens-kuerten jens-kuerten commented Jan 5, 2026

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BOMItemFieldCalculationEvent that follows the same pattern as the existing PartFieldCalculationEvent
  • Adds 120 custom attribute fields to the BOMItem class (20 fields each for char, bigchar, integer, float, boolean, and date types)
  • Updates the get_items_of_type utility 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.

@jens-kuerten jens-kuerten merged commit fa9d014 into main Jan 9, 2026
10 checks passed
@jens-kuerten jens-kuerten deleted the bom-item-field-calculation branch January 9, 2026 13:36
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.

4 participants