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
e0828e20
Commit
e0828e20
authored
Dec 03, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hr: improve add position application
parent
32896659
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
bt5/erp5_hr/SkinTemplateItem/portal_skins/erp5_hr/PositionApplicationModule_addPositionApplication.py
...p5_hr/PositionApplicationModule_addPositionApplication.py
+9
-2
No files found.
bt5/erp5_hr/SkinTemplateItem/portal_skins/erp5_hr/PositionApplicationModule_addPositionApplication.py
View file @
e0828e20
from
erp5.component.module.DateUtils
import
addToDate
from
DateTime
import
DateTime
requester
=
None
if
not
first_name
or
not
last_name
:
raise
ValueError
(
'first or last name is not provided'
)
for
person
in
context
.
portal_catalog
(
portal_type
=
'Person'
,
title
=
'%s %s'
%
(
first_name
,
last_name
)):
if
person
.
getFirstName
()
==
first_name
and
person
.
getLastName
()
==
last_name
:
requester
=
person
...
...
@@ -46,7 +48,7 @@ if web_message_date or web_message_text or web_message_title:
if
response_template
:
response
=
context
.
event_module
.
newContent
(
portal_type
=
'Mail Message'
,
source
=
context
.
ERP5Site_getAuthenticatedMemberPersonValue
(),
source
_value
=
context
.
ERP5Site_getAuthenticatedMemberPersonValue
(),
destination_value
=
requester
,
title
=
'Re: %s'
%
web_message_title
,
start_date
=
addToDate
(
web_message_date
,
to_add
=
{
'minute'
:
1
}),
...
...
@@ -55,7 +57,12 @@ if web_message_date or web_message_text or web_message_title:
content_type
=
'Mail Message'
)
response
.
Event_setTextContentFromNotificationMessage
(
reference
=
response_template
,
substitution_method_parameter_dict
=
dict
(
reply_body
=
event
.
getReplyBody
(),
reply_subject
=
event
.
getReplySubject
()))
substitution_method_parameter_dict
=
dict
(
mapping_dict
=
{
'reply_body'
:
event
.
getReplyBody
(),
'reply_subject'
:
event
.
getReplySubject
(),
'sender_name'
:
context
.
ERP5Site_getAuthenticatedMemberPersonValue
().
getTitle
(),
'recipient_first_name'
:
first_name
,
'position_title'
:
context
.
restrictedTraverse
(
position
).
getTitle
()
}))
...
...
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