Defect #36248
closed
Time entries of sub-projects are not listed when activity is specified in filters
Added by Yuichi HARADA over 2 years ago.
Updated over 2 years ago.
Description
If the activity of the parent project is not a system activity, the time entries of the sub-projects are not displayed when the Activity filter is specified in the spent time list of the parent project.
Activity setting of parent project
![](/attachments/download/28475/settings-time-tracking.png)
When the Activity filter is not used
![](/attachments/download/28478/spent-time-list-without-activity-fillter.png)
When using the Activity filter
![](/attachments/download/28480/spent-time-list-with-activity-fillter.png)
Files
I think the following patch can solve it.
diff --git a/app/models/time_entry_query.rb b/app/models/time_entry_query.rb
index 11128cfcd6..5fd4790893 100644
--- a/app/models/time_entry_query.rb
+++ b/app/models/time_entry_query.rb
@@ -88,7 +88,7 @@ class TimeEntryQuery < Query
activities = (project ? project.activities : TimeEntryActivity.shared)
add_available_filter(
"activity_id",
- :type => :list, :values => activities.map {|a| [a.name, a.id.to_s]}
+ :type => :list, :values => activities.map {|a| [a.name, (a.parent_id || a.id).to_s]}
)
add_available_filter(
"project.status",
I created a test. I have attached a patch containing #note-1.
- Status changed from New to Confirmed
- Target version set to 4.2.4
Setting the target version to 4.2.4.
- Status changed from Confirmed to Resolved
- Assignee set to Marius BĂLTEANU
- Resolution set to Fixed
- Status changed from Resolved to Closed
Also available in: Atom
PDF