Project

General

Profile

Actions

Defect #6310

closed

done ratio is not correct in one of the situations

Added by Kiwamu Kato over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
2010-09-06
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

I noticed that done ratio is not correct in the situation.

Setting of Calculate the issue done ratio with: "Use the issue status".

Status          %Done
New             0
In Progress     10

1. Create issue with "New" status, then done ratio is 0%.
2. Change issue status to "In Progress", then done ratio is 10%.
3. Change back issue status to "New", then done ratio is NOT 0% but 10%.

4. On [Administration] -> [Issue Statuses], execute "Update issue done ratios", then done ration is 0%.

This is why IssueStatus#default_done_ratio? method returns false when default_done_ratio is ZERO.
I checked it trunk head and tags 1.0.1.

% ruby script/console
Loading development environment (Rails 2.3.5)
>> IssueStatus.find_by_name("New").default_done_ratio?
=> false
>> IssueStatus.find_by_name("In Progress").default_done_ratio?
=> true

A simple patch is below.

% svn diff
Index: app/models/issue.rb
===================================================================
--- app/models/issue.rb    (revision xxx)
+++ app/models/issue.rb    (working copy)
@@ -245,7 +245,7 @@
   end

   def done_ratio
-    if Issue.use_status_for_done_ratio? && status && status.default_done_ratio?
+    if Issue.use_status_for_done_ratio? && status && !status.default_done_ratio.nil?
       status.default_done_ratio
     else
       read_attribute(:done_ratio)

Thank you.

Kiwamu Kato


Related issues

Is duplicate of Redmine - Defect #5170: Done ratio can not revert to 0% if status is used for done ratio ClosedEric Davis2010-03-24

Actions
Actions #1

Updated by Mischa The Evil over 13 years ago

  • Assignee set to Eric Davis

Eric, can you take a look at this? I remember that you've written the code for the "Setting of Calculate the issue done ratio with: "Use the issue status""-feature...

Actions #2

Updated by Felix Schäfer over 13 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Closing as a duplicate of #5170, will post a patch soon there.

Actions

Also available in: Atom PDF