Replace box picker with free-text location in audit scan

"Where found" during inventory audit is now a plain text field
(e.g. "каб. 305") stored on the object instead of assigning it to a
box, since audit walks often use room/office labels that don't map
to the box/shelf hierarchy used elsewhere. Box assignment via the
regular object form is unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jze9
2026-07-22 15:41:30 +05:00
parent f99949559c
commit d6a7ac0a68
10 changed files with 77 additions and 50 deletions

View File

@@ -22,6 +22,7 @@ def build_object_read(obj: InventoryObject) -> ObjectRead:
created_at=obj.created_at,
updated_at=obj.updated_at,
last_seen_at=obj.last_seen_at,
last_seen_location=obj.last_seen_location,
qr_code_url=object_public_url(obj.id),
photos=[build_photo_read(p) for p in obj.photos],
)
@@ -64,8 +65,8 @@ async def update_object(db: AsyncSession, obj: InventoryObject, data: ObjectUpda
return await get_object(db, obj.id)
async def mark_object_found(db: AsyncSession, obj: InventoryObject, box_id: uuid.UUID | None) -> InventoryObject:
obj.box_id = box_id
async def mark_object_found(db: AsyncSession, obj: InventoryObject, location: str | None) -> InventoryObject:
obj.last_seen_location = location
obj.last_seen_at = datetime.now(timezone.utc)
await db.commit()
return await get_object(db, obj.id)