Permalink
Browse files

* Fixing Bugs:

 - Community (Location) COntact pages
 -  Staff & Vol Training Reports
 - FilterField for site_id
* Fixing Selenium Tests
* Add comments field to project_activity_type
  • Loading branch information...
1 parent d1da5e6 commit 7476368107ade97251bde7a8efbc3e260e4242ff @michaelhowden michaelhowden committed Oct 5, 2012
View
@@ -549,7 +549,7 @@ def demographic_data():
return s3db.stats_demographic_data_controller()
# -----------------------------------------------------------------------------
-def community_contact():
+def location_contact():
""" Show a list of all community contacts """
return s3_rest_controller()
View
@@ -155,7 +155,8 @@ def model(self):
widget = None,
script = None, # No Item Pack Filter
),
- organisation_id(script = SCRIPT('''
+ organisation_id(required = True,
+ script = SCRIPT('''
$(document).ready(function(){
S3FilterFieldChange({
'FilterField':'organisation_id',
View
@@ -132,6 +132,7 @@ def model(self):
S3FilterFieldChange({
'FilterField':'organisation_id',
'Field':'site_id',
+ 'FieldID':'site_id',
'FieldResource':'site',
'FieldPrefix':'org',
})
@@ -1903,9 +1904,9 @@ def model(self):
cols=report_fields,
facts=report_fields,
methods=["count", "list"],
- defaults=Storage(rows="hrm_training.course_id",
- cols="hrm_training.month",
- fact="hrm_training.person_id",
+ defaults=Storage(rows="training.course_id",
+ cols="training.month",
+ fact="training.person_id",
aggregate="count"),
),
list_fields = [
View
@@ -1481,8 +1481,8 @@ def project(self):
M("List All"),
M("Map", m="map"),
M("Search", m="search"),
- M("List All Community Contacts", f="community_contact"),
- M("Search Community Contacts", f="community_contact",
+ M("List All Community Contacts", f="location_contact"),
+ M("Search Community Contacts", f="location_contact",
m="search"),
),
)
View
@@ -705,6 +705,7 @@ def model(self):
table = define_table(tablename,
Field("name", length=128,
notnull=True, unique=True),
+ s3_comments(),
*s3_meta_fields())
# Field configuration?
@@ -1516,9 +1517,9 @@ def model(self):
msg_record_deleted = T("Contact Deleted"),
msg_list_empty = T("No Contacts Found"))
- community_contact_search = S3Search(
+ location_contact_search = S3Search(
advanced=(S3SearchSimpleWidget(
- name = "community_contact_search_simple",
+ name = "location_contact_search_simple",
label = T("Name"),
comment = T("You can search by person name - enter any of the first, middle or last names, separated by spaces. You may use % as wildcard. Press 'Search' without input to list all persons."),
field = ["person_id$first_name",
@@ -1527,13 +1528,13 @@ def model(self):
]
),
S3SearchOptionsWidget(
- name="community_contact_search_L1",
+ name="location_contact_search_L1",
field="person_id$L1",
location_level="L1",
cols = 3,
),
S3SearchOptionsWidget(
- name="community_contact_search_L2",
+ name="location_contact_search_L2",
field="person_id$L2",
location_level="L2",
cols = 3,
@@ -1543,7 +1544,7 @@ def model(self):
# Resource configuration
#hierarchy = current.gis.get_location_hierarchy()
configure(tablename,
- search_method=community_contact_search,
+ search_method=location_contact_search,
list_fields=["person_id",
# (hierarchy["L0"], "person_id$L0"),
# (hierarchy["L1"], "person_id$L1"),
@@ -57,14 +57,15 @@ def test_asset001_create_asset(self):
"WS-100-17"),
( "item_id",
"Water Purification Unit",
- "autocomplete"),
+ "option"),
#( "type",
# "Other"
# "option"),
( "sn",
"WPU-4536-9381"),
( "supplier",
- "Breville"),
+ "Acme Suppliers",
+ "option"),
( "purchase_date",
today ),
( "purchase_price",
@@ -54,14 +54,19 @@ def test_asset001_create_asset(self):
"WS_100_17"),
( "item_id",
"Blankets",
- "autocomplete"),
- ( "site_id",
- "AP Zone (Office)",
"option"),
+ ("organisation_id",
+ "International Federation of Red Cross and Red Crescent Societies (IFRC)",
+ "option"),
+ ( "site_id",
+ "AP Zone",
+ "option",
+ 4),
( "sn",
"WPU-4536-9381"),
- ( "supplier",
- "Breville"),
+ ( "supply_org_id",
+ "Acme Suppliers",
+ "option"),
( "purchase_date",
today),
( "purchase_price",
@@ -49,7 +49,7 @@ def test_hrm001_create_staff(self):
self.create("hrm_human_resource",
[( "organisation_id",
- "Acme Suppliers",
+ "International Federation of Red Cross and Red Crescent Societies (IFRC)",
"option"),
( "first_name",
"Robert",
@@ -67,8 +67,9 @@ def test_hrm001_create_staff(self):
"Warehouse Manager",
"option"),
( "site_id",
- "AP Zone (Office)",
- "option"),
+ "AP Zone",
+ "option",
+ 3),
]
)
@@ -49,7 +49,7 @@ def test_hrm002_create_volunteer(self):
self.create("hrm_human_resource",
[( "organisation_id",
- "Acme Suppliers",
+ "International Federation of Red Cross and Red Crescent Societies (IFRC)",
"option"),
( "first_name",
"John",
@@ -64,8 +64,9 @@ def test_hrm002_create_volunteer(self):
"Security",
"option"),
( "site_id",
- "AP Zone (Office)",
- "option"),
+ "AP Zone",
+ "option",
+ 3),
]
)
@@ -47,10 +47,10 @@ def test_inv006_create_catalog(self):
self.login(account="admin", nexturl="supply/catalog/create")
self.create("supply_catalog",
[( "name",
- "Romanian Food Catalogue" ),
+ "IFRC Food Catalogue" ),
( "organisation_id",
- "Romanian Food Assistance Association",
- "autocomplete" ),
+ "International Federation of Red Cross and Red Crescent Societies (IFRC)",
+ "option" ),
( "comments",
"This is a test Catalogue")
]
@@ -56,7 +56,7 @@ def test_inv004_create_warehouse(self, items=[0]):
# 1st field used to check whether record already exists
("name", "Bucharest RFAAT Central Warehouse (Test)"),
("code", "12345679"),
- ("organisation_id", "Romanian Food Assistance Association", "autocomplete"),
+ ("organisation_id", "International Federation of Red Cross and Red Crescent Societies (IFRC)", "option"),
("comments", "This is a Test Warehouse"),
],
]
@@ -60,9 +60,13 @@ def test_inv002a_receive_items(self):
"option",
),
("type",
- "-",
+ "Internal Shipment",
"option",
- )
+ ),
+ ("from_site_id",
+ "Ainaro Warehouse (Warehouse)",
+ "option",
+ ),
]
item_data = [
@@ -55,6 +55,10 @@ def test_inv001_send_items(self):
"Timor-Leste Red Cross Society (CVTL) National Warehouse (Warehouse)",
"option",
),
+ ("type",
+ "Internal Shipment",
+ "option",
+ ),
("to_site_id",
"Lospalos Warehouse (Warehouse)",
"option",
@@ -53,6 +53,10 @@ def test_inv003_send_receive_items(self):
"Timor-Leste Red Cross Society (CVTL) National Warehouse (Warehouse)",
"option",
),
+ ("type",
+ "Internal Shipment",
+ "option",
+ ),
("to_site_id",
"Lospalos Warehouse (Warehouse)",
"option",
@@ -126,6 +130,10 @@ def test_inv021_send_and_confirm(self):
"Timor-Leste Red Cross Society (CVTL) National Warehouse (Warehouse)",
"option",
),
+ ("type",
+ "Internal Shipment",
+ "option",
+ ),
("to_site_id",
"Lori (Facility)",
"option",
@@ -49,7 +49,7 @@ def test_mem001_create_member(self):
self.login(account="admin", nexturl="member/membership/create")
self.create("member_membership",
[( "organisation_id",
- "Timor-Leste Red Cross Society",
+ "Timor-Leste Red Cross Society (CVTL)",
"option"),
( "first_name",
"Denise",
@@ -51,7 +51,10 @@ def test_project001_create_project(self):
self.login(account="admin", nexturl="project/project/create")
self.create("project_project",
- [( "name",
+ [("organisation_id",
+ "International Federation of Red Cross and Red Crescent Societies (IFRC)",
+ "option"),
+ ( "name",
"Community Strengthening through Dance" ),
( "comments",
"Host National Society")
@@ -100,14 +103,8 @@ def test_project001_create_project(self):
"gis_location"),
( "lon",
"0",
- "gis_location"),
+ "gis_location")
# @ToDo: Activities - Community Organisation, Contingency Planning, Logistics
- ( "population",
- "1000"),
- ( "number_families",
- "200"),
- ( "comments",
- "First Community")
]
)
Oops, something went wrong.

0 comments on commit 7476368

Please sign in to comment.