Compare commits

..

1 Commits

Author SHA1 Message Date
Zoe Forbes
383eefce9c fix(UX): offer registration when BOM opened on untracked document (#56)
Replace the dead-end warning in Silo_BOM with a question dialog that
offers to register the document via Silo_New. If the user accepts and
registration succeeds, the BOM dialog opens seamlessly.
2026-02-08 18:46:22 -06:00

View File

@@ -1998,15 +1998,18 @@ class Silo_BOM:
obj = get_tracked_object(doc)
if not obj:
FreeCAD.Console.PrintError("No tracked Silo item in active document.\n")
from PySide import QtGui as _qg
_qg.QMessageBox.warning(
reply = QtGui.QMessageBox.question(
None,
"BOM",
"This document is not registered with Silo.\nUse Silo > New to register it first.",
"This document is not registered with Silo.\n\nRegister it now?",
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
)
return
if reply != QtGui.QMessageBox.Yes:
return
FreeCADGui.runCommand("Silo_New")
obj = get_tracked_object(doc)
if not obj:
return
part_number = obj.SiloPartNumber