Commit 244f0873 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_project: project/lie may have no task

parent 01e636b6
......@@ -43,8 +43,9 @@ else:
def calculateQuantity(relative_url):
quantity = 0
for task in task_by_project[relative_url]:
quantity += task.getTaskLineQuantity()
if relative_url in task_by_project:
for task in task_by_project[relative_url]:
quantity += task.getTaskLineQuantity()
for project_line in relation_dict[relative_url]:
quantity += calculateQuantity(project_line)
return quantity
......
......@@ -228,6 +228,10 @@ class TestProject(ERP5TypeTestCase):
if not project.has_key('project_line_%s' % key):
project.newContent(portal_type='Project Line', id='project_line_%s' % key)
# project line which has no task
if not project.has_key('project_line_has_no_task'):
project.newContent(portal_type='Project Line', id='project_line_has_no_task')
if not project.project_line_1.has_key('project_line_1_1'):
project.project_line_1.newContent(portal_type='Project Line', id='project_line_1_1')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment