[FIX] project_issue: explicit store attribute for the progress function field
authorJulien Legros <jle@odoo.com>
Thu, 30 Oct 2014 16:58:29 +0000 (17:58 +0100)
committerJulien Legros <jle@odoo.com>
Thu, 30 Oct 2014 17:07:07 +0000 (18:07 +0100)
This is a workaround for an ORM limitation. A stored function field is
not updated when it should if the "source" field is also a stored function
field

addons/project_issue/project_issue.py

index 20a6165..efb4e4e 100644 (file)
@@ -306,7 +306,7 @@ class project_issue(base_stage, osv.osv):
         'progress': fields.function(_hours_get, string='Progress (%)', multi='hours', group_operator="avg", help="Computed as: Time Spent / Total Time.",
             store = {
                 'project.issue': (lambda self, cr, uid, ids, c={}: ids, ['task_id'], 10),
-                'project.task': (_get_issue_task, ['progress'], 10),
+                'project.task': (_get_issue_task, ['work_ids', 'remaining_hours', 'planned_hours', 'state', 'stage_id'], 10),
                 'project.task.work': (_get_issue_work, ['hours'], 10),
             }),
     }