drawings: VISUAL's rev is the source of truth; attach it when M-Files holds it Effective or Retired
When M-Files' Effective rev differs from the rev VISUAL calls, the drawing job looks that rev up (MFilesKit DrawingLookup.revision). If M-Files has it as Effective or Retired, the job copies it into drawing_revisions and attaches it to the draft with no flag and no Clerical approval, so the draft can auto-release. Past draft, already attached or with a hand drawing: unchanged, no flag and no change order. Any other status, or no document at that rev, still flags rev_mismatch with a note saying why. Packet Station only ever attaches Effective or Retired drawings. rev_approve stays for that case only. This replaces the "Use rev V as VISUAL calls it" choice from #46: the use=called path in rev-approve and its button are removed. A packet that already kept the rev that way keeps it, since that rev is now used anyway. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -646,19 +646,6 @@ def staged_rev(conn: Any, drawing: Any) -> dict[str, Any] | None:
|
||||
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:
|
||||
"""The drawing_lookups row for a drawing number when it holds a fetched copy (asset and rev set)."""
|
||||
dwg = str(drawing or "").strip()
|
||||
|
||||
Reference in New Issue
Block a user