~erobererunc/sahana-eden/tropo_xforms

« back to all changes in this revision

Viewing changes to models/06_lms.py

  • Committer: Michael
  • Date: 2010-12-16 13:45:28 UTC
  • mfrom: (1479.1.91 eden)
  • Revision ID: ero@gmail.com-20101216134528-7x3m6m3fk9uc9i69
mergeĀ fromĀ trunk...

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        )
68
68
 
69
69
    table.base_unit.requires = IS_NULL_OR(IS_ONE_OF(db, "lms_unit.label", "lms_unit.name"))
70
 
    table.label.requires=IS_NOT_IN_DB(db, "%s.label" % tablename)
 
70
    table.label.requires=IS_NOT_ONE_OF(db, "%s.label" % tablename)
71
71
    table.label.label = T("Unit")
72
72
    table.label.comment = DIV( _class="tooltip", _title=T("Label") + "|" + T("Unit Short Code for e.g. m for meter."))
73
73
    table.name.comment = DIV( _class="tooltip", _title=T("Unit Name") + "|" + T("Complete Unit Label for e.g. meter for m."))
121
121
                    comments(),
122
122
                    migrate=migrate,
123
123
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
124
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
124
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
125
125
    table.name.requires = IS_NOT_EMPTY()   # Sites don't have to have unique names
126
126
    table.name.label = T("Site Name")
127
127
    table.name.comment = DIV( _class="tooltip", _title=T("Site Name") + "|" + T("A Warehouse/Site is a physical location with an address and GIS data where Items are Stored. It can be a Building, a particular area in a city or anything similar."))
164
164
                    migrate=migrate,
165
165
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
166
166
 
167
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
167
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
168
168
    table.name.requires = IS_NOT_EMPTY()   # Storage Locations don"t have to have unique names
169
169
    table.site_id.label = T("Site")
170
170
    table.site_id.requires = IS_IN_DB(db, "lms_site.id", "lms_storage_loc.name")
206
206
                    Field("description"),
207
207
                    migrate=migrate,
208
208
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
209
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
209
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
210
210
    table.name.requires = IS_NOT_EMPTY()
211
211
    table.name.comment = DIV( _class="tooltip", _title=T("Storage Bin Type") + "|" + T("Name of Storage Bin Type."))
212
212
    table.description.comment = DIV( _class="tooltip", _title=T("Description of Bin Type") + "|" + T("Use this space to add a description about the Bin Type."))
243
243
                    comments(),
244
244
                    migrate=migrate,
245
245
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
246
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
246
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
247
247
    table.site_id.requires = IS_IN_DB(db, "lms_site.id", "lms_storage_loc.name")
248
248
    table.site_id.label = T("Site/Warehouse")
249
249
    table.site_id.comment = DIV(A(T("Add Site"), _class="colorbox", _href=URL(r=request, c="lms", f="site", args="create", vars=dict(format="popup")), _target="top"), DIV( _class="tooltip", _title=T("Site") + "|" + T("Add the main Warehouse/Site information where this Bin belongs to.")))
294
294
                    comments(),
295
295
                    migrate=migrate,
296
296
                    *(s3_timestamp()+s3_uid()+s3_deletion_status()))
297
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
297
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
298
298
    table.name.requires = IS_NOT_EMPTY()
299
299
    table.name.label = T("Catalog Name")
300
300
    ADD_ITEM_CATALOG = T("Add Item Catalog ")
323
323
                    comments(),
324
324
                    migrate=migrate,
325
325
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
326
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
326
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
327
327
    table.name.requires = IS_NOT_EMPTY()
328
328
    table.name.label = T("Item Catalog Category")
329
329
    ADD_ITEM_CATALOG_CATEGORY = T("Add Item Catalog Category ")
353
353
                    comments(),
354
354
                    migrate=migrate,
355
355
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
356
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
356
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
357
357
    table.name.requires = IS_NOT_EMPTY()
358
358
    table.name.label = T("Item Sub-Category")
359
359
    table.parent_category.requires = IS_IN_DB(db, "lms_catalog_cat.id", "lms_catalog_cat.name")
430
430
                            Field("track_status", readable="False"), # Linked to Shipment Transit Log table
431
431
                            migrate=migrate,
432
432
                            *(s3_timestamp() + s3_uid() + s3_deletion_status()))
433
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
433
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
434
434
    table.way_bill.requires = IS_NOT_EMPTY()
435
435
    table.way_bill.label = T("Shipment/Way Bills")
436
436
    table.sender_site.requires = IS_IN_DB(db, "lms_site.id", "lms_site.name")
488
488
                    Field("unit_cost", "double", default=0.00),
489
489
                    migrate=migrate,
490
490
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
491
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
491
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
492
492
    table.site_id.requires = IS_IN_DB(db, "lms_site.id", "lms_storage_loc.name") #this should be automatically done. Using LMS User Preferences
493
493
    table.site_id.label = T("Site/Warehouse")
494
494
    table.site_id.comment = DIV(A(T("Add Site"), _class="colorbox", _href=URL(r=request, c="lms", f="site", args="create", vars=dict(format="popup")), _target="top"), DIV( _class="tooltip", _title=T("Site") + "|" + T("Add the main Warehouse/Site information where this Item is to be added.")))
542
542
                    Field("item_id", db.lms_item),
543
543
                    migrate=migrate,
544
544
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
545
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
545
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
546
546
    table.shipment_id.requires = IS_IN_DB(db, "lms_shipment.id", "lms_shipment.way_bill")
547
547
    table.item_id.requires = IS_IN_DB(db, "lms_item.id", "lms_item.name") #This needs to be represented as Name+Brand+Model+Description+Size
548
548
    s3.crud_strings[tablename] = Storage(
570
570
                    Field("item_id", db.lms_item),
571
571
                    migrate=migrate,
572
572
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
573
 
    table.uuid.requires = IS_NOT_IN_DB(db, "%s.uuid" % tablename)
 
573
    table.uuid.requires = IS_NOT_ONE_OF(db, "%s.uuid" % tablename)
574
574
    table.shipment_id.requires = IS_IN_DB(db, "lms_shipment.id", "lms_shipment.way_bill")
575
575
    table.item_id.requires = IS_IN_DB(db, "lms_item.id", "lms_item.name") #This needs to be represented as Name+Brand+Model+Description+Size
576
576
    ADD_SHIPMENT_TRANSIT_LOG = T("Add Shipment Transit Log")
603
603
                    comments(),
604
604
                    migrate=migrate,
605
605
                    *(s3_timestamp() + s3_uid() + s3_deletion_status()))
606
 
    table.code.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, "%s.code" % tablename)]
 
606
    table.code.requires = [IS_NOT_EMPTY(), IS_NOT_ONE_OF(db, "%s.code" % tablename)]
607
607
    table.code.label = T("Code")
608
608
    table.description.label = T("Description")
609
609
    table.total_unit_cost.label = T("Total Unit Cost")