Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
244f0873
Commit
244f0873
authored
Nov 05, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_project: project/lie may have no task
parent
01e636b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateQuantityAndUnit.py
...ortal_skins/erp5_project/Project_updateQuantityAndUnit.py
+3
-2
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.py
...stTemplateItem/portal_components/test.erp5.testProject.py
+4
-0
No files found.
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateQuantityAndUnit.py
View file @
244f0873
...
...
@@ -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
...
...
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.py
View file @
244f0873
...
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment