-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor Homepage enhancements for Nepal #1084
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1050,6 +1050,8 @@ def model(self): | |
#send_type_opts.update(self.inv_item_status_opts) | ||
send_type_opts.update(settings.get_inv_send_types()) | ||
|
||
ADD_FACILITY = T("Create Facility") | ||
|
||
site_types = auth.org_site_types | ||
tablename = "inv_send" | ||
define_table(tablename, | ||
|
@@ -1094,6 +1096,10 @@ def model(self): | |
not_filterby = "obsolete", | ||
not_filter_opts = (True,), | ||
)), | ||
comment = S3AddResourceLink(c="org", | ||
f="facility", | ||
label=ADD_FACILITY, | ||
title=ADD_FACILITY) | ||
), | ||
organisation_id( | ||
label = T("To Organization"), | ||
|
@@ -1183,6 +1189,8 @@ def model(self): | |
s3_comments(), | ||
*s3_meta_fields()) | ||
|
||
levels = current.gis.get_relevant_hierarchy_levels() | ||
|
||
# Filter Widgets | ||
filter_widgets = [ | ||
S3TextFilter(["sender_id$first_name", | ||
|
@@ -1194,7 +1202,7 @@ def model(self): | |
"recipient_id$first_name", | ||
"recipient_id$middle_name", | ||
"recipient_id$last_name", | ||
], | ||
] + ["to_site_id$location_id$%s" % level for level in levels], | ||
label = T("Search"), | ||
comment = T("Search for an item by text."), | ||
), | ||
|
@@ -1204,6 +1212,9 @@ def model(self): | |
cols = 2, | ||
hidden = True, | ||
), | ||
S3LocationFilter("to_site_id$location_id", | ||
levels=levels, | ||
), | ||
S3TextFilter("type", | ||
label = T("Shipment Type"), | ||
hidden = True, | ||
|
@@ -1875,6 +1886,12 @@ def model(self): | |
label = T("Search"), | ||
#comment = recv_search_comment, | ||
), | ||
S3OptionsFilter("send_id$site_id"), | ||
S3LocationFilter("send_id$to_site_id$location_id", | ||
#hidden=True, | ||
label=T("Sent to Location"), | ||
levels=levels, | ||
), | ||
S3DateFilter("send_id$date", | ||
label = T("Sent date"), | ||
hidden = True, | ||
|
@@ -2142,7 +2159,8 @@ def inv_send_controller(cls): | |
s3 = response.s3 | ||
|
||
# Limit site_id to sites the user has permissions for | ||
error_msg = T("You do not have permission for any facility to send a shipment.") | ||
error_msg = T("You do not have permission for any %s to send a shipment.") % \ | ||
current.deployment_settings.get_inv_facility_label() | ||
current.auth.permitted_facilities(table=sendtable, error_msg=error_msg) | ||
|
||
# Set Validator for checking against the number of items in the warehouse | ||
|
@@ -2534,7 +2552,7 @@ def inv_send_process(): | |
site_id = send_record.to_site_id, | ||
comments = send_record.comments, | ||
status = SHIP_STATUS_SENT, | ||
type = 1, # 1:"Another Inventory" | ||
type = 11, # 11:"Another Inventory" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, this seems like we're hardcoding somethign which is configurable? Always nasty, but can be mitigated with lots of warnings in code about other locations this is used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - this is nothing new... |
||
) | ||
|
||
# Change the status for all track items in this shipment to In transit | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,6 +425,10 @@ def model(self): | |
supply_item_represent = supply_ItemRepresent(show_link=True) | ||
|
||
# Reusable Field | ||
if settings.get_supply_autocomplete(): | ||
default_widget = S3AutocompleteWidget("supply", "item") | ||
else: | ||
default_widget = None | ||
supply_item_id = S3ReusableField("item_id", | ||
"reference %s" % tablename, # 'item_id' for backwards-compatibility | ||
label = T("Item"), | ||
|
@@ -434,7 +438,7 @@ def model(self): | |
supply_item_represent, | ||
sort=True), | ||
sortby = "name", | ||
widget = S3AutocompleteWidget("supply", "item"), | ||
widget = default_widget, | ||
comment=S3AddResourceLink(c="supply", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a deployment_setting. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
f="item", | ||
label=ADD_ITEM, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you changed/added some keys here. If you do that, please make sure the same keys are available in every icon set - or, if that is not possible, move the additional keys into settings.ui.custom_icons (same dict structure).
All icon sets should have a consistent set of default icons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to settings.ui.custom_icons