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:
@@ -484,8 +484,11 @@ def test_auto_release(fx: Settings) -> None:
|
||||
assert wh["stage"] == "incoming" and wh["by"] is None
|
||||
tr = row(conn, "SELECT * FROM packet_transitions WHERE packet_id = %s", (wp["id"],))
|
||||
assert tr["action"] == "vis_auto_release" and tr["by"] is None
|
||||
# VISUAL calls rev 2, which M-Files holds as Retired: attached without a flag, so it is released too
|
||||
two = packet_by_key(conn, gen.KEY_TWO_OPS)
|
||||
assert two is not None and two["status"] == "warehouse" and two["visual"]["vault"]["controlled"] == "Retired"
|
||||
# flagged drafts stay with Clerical
|
||||
for key in (gen.KEY_TWO_OPS, gen.KEY_NOT_FOUND, gen.KEY_DRAFTING, gen.KEY_NO_DWG):
|
||||
for key in (gen.KEY_NOT_FOUND, gen.KEY_DRAFTING, gen.KEY_NO_DWG):
|
||||
p = packet_by_key(conn, key)
|
||||
assert p is not None and p["status"] == "draft", key
|
||||
assert all(r[0] == "system" for r in system_audit(conn, "packet.vis_auto_release"))
|
||||
|
||||
Reference in New Issue
Block a user