Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
02aa4b16
Commit
02aa4b16
authored
Jan 16, 2020
by
John Red Medrano
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product-dev' of
http://42.61.118.105:7990/scm/rms/api-main-service
into red-develop
parents
b1a6e858
6e86c6d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
29 deletions
+30
-29
app/applicationlayer/cms/form/header/views.py
app/applicationlayer/cms/form/header/views.py
+30
-1
app/applicationlayer/cms/form/onbehalf/views.py
app/applicationlayer/cms/form/onbehalf/views.py
+0
-28
No files found.
app/applicationlayer/cms/form/header/views.py
View file @
02aa4b16
...
...
@@ -708,7 +708,23 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
self
.
perform_update
(
serializer
)
new_instance
=
serializer
.
data
original_user
=
new_instance
[
'user'
][
'code'
]
if
original_user
==
current_user
:
data_update
=
{
"on_behalf"
:
None
}
else
:
data_update
=
{
"on_behalf"
:
{
'code'
:
self
.
request
.
user
.
code
,
'name'
:
self
.
request
.
user
.
name
}
}
new_instance
=
{
**
new_instance
,
**
data_update
}
crhistory_save
(
batchno
,
enums
.
CREnum
.
ACTION
.
value
,
...
...
@@ -1056,6 +1072,18 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
data
=
data
[
'toValue'
]
.
replace
(
"'"
,
'"'
)
.
replace
(
'None'
,
'""'
)
.
replace
(
'True'
,
'""'
)
.
replace
(
'False'
,
'""'
)
convert
=
json
.
loads
(
data
)
try
:
if
convert
[
'on_behalf'
]
and
not
convert
[
'on_behalf'
]
==
None
:
# format: Rejected on behalf by Rita Fantilga
on_behalf
=
(
convert
[
'action'
]
.
capitalize
()
+
' on behalf by '
+
convert
[
'on_behalf'
][
'name'
])
else
:
on_behalf
=
None
except
Exception
as
e
:
on_behalf
=
None
history_dict
=
{
"name"
:
convert
[
'user'
][
'name'
],
"department"
:
convert
[
'department'
][
'name'
],
...
...
@@ -1064,6 +1092,7 @@ class ChangeRequestFormsViewset(viewsets.ModelViewSet):
"delegation"
:
convert
[
'delegation'
],
"action"
:
convert
[
'action'
],
"remarks"
:
convert
[
'remarks'
],
"on_behalf"
:
on_behalf
,
"created"
:
convert
[
'action_date'
]
}
...
...
app/applicationlayer/cms/form/onbehalf/views.py
View file @
02aa4b16
...
...
@@ -24,18 +24,6 @@ from app.applicationlayer.utils import (QuerySetHelper,
send_broadcast_message
)
from
app.businesslayer.changerequest
import
change_request
from
app.applicationlayer.cms.utils_cr
import
(
number_generator
,
send_mail_requestor
,
next_approver_email
,
crhistory_save
,
send_mail_vendor
,
get_max_batchno
,
generate_template_id
,
crhistory_create_save
,
entity_log_bulk
,
reminder_trigger_save
,
overdue_trigger_save
,
reset_autoemail_tables
)
from
app.entities
import
enums
from
app.applicationlayer.utils
import
model_to_dict
...
...
@@ -67,25 +55,9 @@ from django_filters.rest_framework import DjangoFilterBackend
import
json
from
app.applicationlayer.utils
import
main_threading
from
django.core.files.base
import
ContentFile
from
django.conf
import
settings
from
io
import
BytesIO
from
django.http
import
HttpResponse
from
xhtml2pdf
import
pisa
config
=
configparser
.
ConfigParser
()
config_file
=
os
.
path
.
join
(
'./'
,
'env.ini'
)
config
.
read
(
config_file
)
APPROVER_MESSAGE
=
settings
.
APPROVER_MESSAGE
REQUESTOR_MESSAGE
=
settings
.
REQUESTOR_MESSAGE
REQUESTOR_REJECT_MESSAGE
=
settings
.
REQUESTOR_REJECT_MESSAGE
VENDOR_ACKNOWLEDGE_MESSAGE
=
settings
.
VENDOR_ACKNOWLEDGE_MESSAGE
REQUESTOR_ACKNOWLEDGE_MESSAGE
=
settings
.
REQUESTOR_ACKNOWLEDGE_MESSAGE
REQUESTOR_COMPLETION_MESSAGE
=
settings
.
REQUESTOR_COMPLETION_MESSAGE
VENDOR_ACCEPTANCE_MESSAGE
=
settings
.
VENDOR_ACCEPTANCE_MESSAGE
VENDOR_REJECT_MESSAGE
=
settings
.
VENDOR_REJECT_MESSAGE
class
ChangeRequestFormsViewset
(
viewsets
.
ModelViewSet
):
...
...
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