See #6570. Better cost item rate identification

Now show cost item rate shows the Identification and not the ID for better understanding
This commit is contained in:
Massimo Fabbro
2025-05-31 15:57:26 +02:00
committed by Massimo Fabbro
parent eade620581
commit 390349aa7a
2 changed files with 4 additions and 3 deletions
@@ -613,7 +613,7 @@ class ShowAssignedCostRate(bpy.types.Operator):
bl_idname = "bim.show_assigned_cost_rate"
bl_label = "Info about the assigned cost item rate"
bl_options = {"REGISTER"}
assigned_rate_id: bpy.props.IntProperty()
assigned_rate_identification: bpy.props.StringProperty()
assigned_rate_name: bpy.props.StringProperty()
assigned_rate_description: bpy.props.StringProperty()
assigned_rate_total_value: bpy.props.FloatProperty()
@@ -629,7 +629,7 @@ class ShowAssignedCostRate(bpy.types.Operator):
def draw(self, context):
layout = self.layout
wrapper = textwrap.TextWrapper(width=80)
layout.label(text=f"ID: {self.assigned_rate_id}")
layout.label(text=f"ID: {self.assigned_rate_identification}")
layout.label(text=f"Name: {self.assigned_rate_name}")
layout.label(text="Description:")
for line in wrapper.wrap(str(self.assigned_rate_description)):
+2 -1
View File
@@ -733,7 +733,8 @@ class BIM_UL_cost_items_trait:
row.alignment = "LEFT"
if cost_item["AssignedCostRate"] is not None:
op = row.operator("bim.show_assigned_cost_rate", text="", emboss=False, icon="ZOOM_IN")
op.assigned_rate_id = cost_item["AssignedCostRate"].id()
identification = cost_item["AssignedCostRate"].Identification
op.assigned_rate_identification = identification if identification is not None else "XXX"
op.assigned_rate_name = cost_item["AssignedCostRate"].Name or ""
op.assigned_rate_description = cost_item["AssignedCostRate"].Description or ""
op.assigned_rate_total_value = CostSchedulesData.data["cost_items"][cost_item["AssignedCostRate"].id()][