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
6f038296
Commit
6f038296
authored
Oct 09, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_project: add action to update project date
parent
9c9248f0
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
755 additions
and
3 deletions
+755
-3
bt5/erp5_project/ActionTemplateItem/portal_types/Project%20Line/update_date.xml
...nTemplateItem/portal_types/Project%20Line/update_date.xml
+85
-0
bt5/erp5_project/ActionTemplateItem/portal_types/Project/update_date.xml
...t/ActionTemplateItem/portal_types/Project/update_date.xml
+85
-0
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDate.py
...plateItem/portal_skins/erp5_project/Project_updateDate.py
+26
-0
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDate.xml
...lateItem/portal_skins/erp5_project/Project_updateDate.xml
+62
-0
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDateDialog.xml
...em/portal_skins/erp5_project/Project_updateDateDialog.xml
+139
-0
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDateDialog/your_message.xml
...ns/erp5_project/Project_updateDateDialog/your_message.xml
+280
-0
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.py
...stTemplateItem/portal_components/test.erp5.testProject.py
+52
-0
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.xml
...tTemplateItem/portal_components/test.erp5.testProject.xml
+24
-3
bt5/erp5_project/bt/template_action_path_list
bt5/erp5_project/bt/template_action_path_list
+2
-0
No files found.
bt5/erp5_project/ActionTemplateItem/portal_types/Project%20Line/update_date.xml
0 → 100644
View file @
6f038296
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jio_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jio_action
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
update_date
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
Modify portal content
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
25.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Update Date
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Project_updateDateDialog
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_project/ActionTemplateItem/portal_types/Project/update_date.xml
0 → 100644
View file @
6f038296
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_jio_action
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_jio_action
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
update_date
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
Modify portal content
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
25.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Update Date
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Project_updateDateDialog
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDate.py
0 → 100644
View file @
6f038296
task_list
=
context
.
Project_getTaskListRecursively
(
portal_type
=
'Task'
)
if
len
(
task_list
)
==
0
:
return
context
.
Base_redirect
(
'view'
,
keep_items
=
{
'portal_status_message'
:
'No related task found'
})
min_start_date
=
task_list
[
0
].
getStartDate
()
max_stop_date
=
task_list
[
0
].
getStopDate
()
message_list
=
[
'Date updated'
]
for
task
in
task_list
:
start_date
=
task
.
getStartDate
()
stop_date
=
task
.
getStopDate
()
if
not
start_date
:
message_list
.
append
(
'%s has no start date'
%
task
.
getRelativeUrl
())
elif
start_date
<
min_start_date
:
min_start_date
=
start_date
if
not
stop_date
:
message_list
.
append
(
'%s has no stop date'
%
task
.
getRelativeUrl
())
elif
stop_date
>
max_stop_date
:
max_stop_date
=
stop_date
context
.
edit
(
start_date
=
min_start_date
,
stop_date
=
max_stop_date
)
return
context
.
Base_redirect
(
'view'
,
keep_items
=
{
'portal_status_message'
:
' '
.
join
(
message_list
)})
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDate.xml
0 → 100644
View file @
6f038296
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Project_updateDate
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDateDialog.xml
0 → 100644
View file @
6f038296
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ERP5 Form"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
Project_updateDate
</string>
</value>
</item>
<item>
<key>
<string>
action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
edit_order
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
enctype
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
group_list
</string>
</key>
<value>
<list>
<string>
left
</string>
<string>
right
</string>
<string>
center
</string>
<string>
bottom
</string>
<string>
hidden
</string>
</list>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
bottom
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
center
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
left
</string>
</key>
<value>
<list>
<string>
your_message
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Project_updateDateDialog
</string>
</value>
</item>
<item>
<key>
<string>
method
</string>
</key>
<value>
<string>
POST
</string>
</value>
</item>
<item>
<key>
<string>
name
</string>
</key>
<value>
<string>
Project_updateDateDialog
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
ERP5 Form
</string>
</value>
</item>
<item>
<key>
<string>
pt
</string>
</key>
<value>
<string>
form_dialog
</string>
</value>
</item>
<item>
<key>
<string>
row_length
</string>
</key>
<value>
<int>
4
</int>
</value>
</item>
<item>
<key>
<string>
stored_encoding
</string>
</key>
<value>
<string>
UTF-8
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Update Project Date
</string>
</value>
</item>
<item>
<key>
<string>
unicode_mode
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
update_action
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
update_action_title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_updateDateDialog/your_message.xml
0 → 100644
View file @
6f038296
This diff is collapsed.
Click to expand it.
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.py
View file @
6f038296
...
...
@@ -80,6 +80,13 @@ class TestProject(ERP5TypeTestCase):
title
=
'Project_1'
,
id
=
'Project_1'
)
if
not
self
.
portal
.
project_module
.
has_key
(
'Project_2'
):
self
.
portal
.
project_module
.
newContent
(
portal_type
=
'Project'
,
reference
=
'Project_2'
,
title
=
'Project_2'
,
id
=
'Project_2'
)
# Create resources
module
=
self
.
portal
.
product_module
if
not
module
.
has_key
(
'development'
):
...
...
@@ -162,6 +169,51 @@ class TestProject(ERP5TypeTestCase):
self
.
assertNotEquals
(
task_line_list
[
0
].
getCausalityRelatedValue
(),
task
.
default_task_line
)
def
testProject_updateDate
(
self
):
# Create Tasks
task_module
=
self
.
getPortalObject
().
task_module
project
=
self
.
getPortalObject
().
project_module
.
Project_2
project
.
edit
(
start_date
=
DateTime
(
'2009/07/25'
),
stop_date
=
DateTime
(
'2009/07/25'
))
if
not
project
.
has_key
(
'project_line_2'
):
project
.
newContent
(
portal_type
=
'Project Line'
,
id
=
'project_line_2'
)
task
=
task_module
.
newContent
(
portal_type
=
'Task'
,
title
=
'Task 2'
,
specialise
=
self
.
business_process
,
task_line_quantity
=
3
,
resource
=
'product_module/development'
,
source
=
'organisation_module/Organisation_1'
,
source_section
=
'organisation_module/Organisation_1'
,
destination
=
'organisation_module/Organisation_2'
,
destination_section
=
'organisation_module/Organisation_2'
,
source_project
=
'project_module/Project_2'
,
start_date
=
DateTime
(
'2009/07/23'
),
stop_date
=
DateTime
(
'2009/07/26'
),
)
self
.
tic
()
project
.
Project_updateDate
()
self
.
assertEqual
(
project
.
getStartDate
(),
task
.
getStartDate
())
self
.
assertEqual
(
project
.
getStopDate
(),
task
.
getStopDate
())
task3
=
task_module
.
newContent
(
portal_type
=
'Task'
,
title
=
'Task 3'
,
specialise
=
self
.
business_process
,
task_line_quantity
=
3
,
resource
=
'product_module/development'
,
source
=
'organisation_module/Organisation_1'
,
source_section
=
'organisation_module/Organisation_1'
,
destination
=
'organisation_module/Organisation_2'
,
destination_section
=
'organisation_module/Organisation_2'
,
source_project
=
'project_module/Project_2/project_line_2'
,
start_date
=
DateTime
(
'2009/06/01'
),
stop_date
=
DateTime
(
'2009/09/01'
),
)
self
.
tic
()
project
.
Project_updateDate
()
self
.
tic
()
self
.
assertEqual
(
project
.
getStartDate
(),
task3
.
getStartDate
())
self
.
assertEqual
(
project
.
getStopDate
(),
task3
.
getStopDate
())
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestProject
))
...
...
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.xml
View file @
6f038296
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testProject
</string>
</value>
...
...
@@ -53,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -72,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -81,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_project/bt/template_action_path_list
View file @
6f038296
...
...
@@ -16,6 +16,7 @@ Project Line | jump_to_task_and_task_report
Project Line | task_fast_input_dialog
Project Line | task_list
Project Line | task_report_list
Project Line | update_date
Project Line | view
Project Milestone | create_new_file
Project Milestone | document_list
...
...
@@ -47,6 +48,7 @@ Project | task_fast_input_dialog
Project | task_list
Project | task_report_list
Project | transactions
Project | update_date
Project | view
Requirement Document | cleanup_descriptions
Requirement Document | detailed_report
...
...
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