Asset-side printer save, status CRUD, real printer types, network fix
- Printers save through the asset blueprint (PUT /printers) instead of the legacy machines API; restrict supply-model picker to printer models. - Asset statuses get full CRUD (PUT/DELETE with in-use guard); canonical set. - Printer types reseeded to a real classification set + list filter. - Equipment accepts gauge/maintenance references. - Fix network list emitting network_device instead of networkdevice (View 404). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -282,6 +282,8 @@ def create_equipment():
|
||||
asset = Asset(
|
||||
assetnumber=data['assetnumber'],
|
||||
name=data.get('name'),
|
||||
gaugelabreference=data.get('gaugelabreference'),
|
||||
maintenancereference=data.get('maintenancereference'),
|
||||
serialnumber=data.get('serialnumber'),
|
||||
assettypeid=equipment_type.assettypeid,
|
||||
statusid=data.get('statusid', 1),
|
||||
@@ -357,8 +359,10 @@ def update_equipment(equipment_id: int):
|
||||
changes = {}
|
||||
|
||||
# Update asset fields
|
||||
asset_fields = ['assetnumber', 'name', 'serialnumber', 'statusid',
|
||||
'locationid', 'businessunitid', 'mapx', 'mapy', 'notes', 'isactive']
|
||||
asset_fields = ['assetnumber', 'name', 'gaugelabreference',
|
||||
'maintenancereference', 'serialnumber', 'statusid',
|
||||
'locationid', 'businessunitid', 'mapx', 'mapy',
|
||||
'notes', 'isactive']
|
||||
for key in asset_fields:
|
||||
if key in data:
|
||||
old_val = getattr(asset, key)
|
||||
|
||||
Reference in New Issue
Block a user