drawings: on a rev mismatch, Clerical can keep the retired rev VISUAL calls (#41)
When VISUAL calls a rev that M-Files has retired, the draft is still flagged rev_mismatch, but the drawing job now also copies the rev VISUAL calls (MFilesKit 0.1.3 DrawingLookup.revision) into drawing_revisions and visual.called. A Clerical Supervisor picks either rev on the packet: "Use latest rev N" as before, or "Use rev V as VISUAL calls it" (rev-approve with use=called), with a reason and a signature. The kept rev holds while M-Files' Effective rev stays the one chosen against: no flag, no change order. A newer Effective rev flags the packet again; a new VISUAL rev clears the choice. Migration 0009 adds drawing_revisions. Needs mfileskit 0.1.3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -643,7 +643,20 @@ def staged_rev(conn: Any, drawing: Any) -> dict[str, Any] | None:
|
||||
lk = staged_lookup(conn, drawing)
|
||||
if lk is None:
|
||||
return None
|
||||
return {"rev": lk["rev"], "name": lk["name"]}
|
||||
return {"rev": lk["rev"], "name": lk["name"], "asset_id": str(lk["asset_id"])}
|
||||
|
||||
|
||||
def called_lookup(conn: Any, drawing: Any, rev: Any) -> dict[str, Any] | None:
|
||||
"""The drawing_revisions row for the rev VISUAL calls, when the drawing job copied it (asset set)."""
|
||||
dwg = str(drawing or "").strip()
|
||||
r = str(rev or "").strip()
|
||||
if not dwg or not r.isdigit():
|
||||
return None
|
||||
return one(
|
||||
conn,
|
||||
"SELECT * FROM drawing_revisions WHERE dwg = %s AND rev = %s AND asset_id IS NOT NULL",
|
||||
(dwg, int(r)),
|
||||
)
|
||||
|
||||
|
||||
def staged_lookup(conn: Any, drawing: Any) -> dict[str, Any] | None:
|
||||
|
||||
Reference in New Issue
Block a user