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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
amrani
erp5
Commits
3ec33714
Commit
3ec33714
authored
Jul 26, 2017
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_travel_expense: Update migration data for Travel expense
parent
70cf248e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_migrateData.py
...eItem/portal_skins/erp5_hr_record/ERP5Site_migrateData.py
+27
-0
No files found.
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/ERP5Site_migrateData.py
View file @
3ec33714
portal
=
context
.
getPortalObject
()
# Update Photos
for
record
in
portal
.
expense_record_module
.
objectValues
(
portal_type
=
"Expense Record"
):
ticket
=
record
.
getFollowUpValue
()
photo_data
=
record
.
getPhotoData
()
if
photo_data
:
if
","
in
photo_data
and
ticket
:
if
ticket
.
getReference
():
photo_data
=
photo_data
.
split
(
","
)[
1
]
image
=
portal
.
portal_contributions
.
newContent
(
data
=
photo_data
.
decode
(
'base64'
),
reference
=
ticket
.
getReference
()
+
"-justificatif"
,
title
=
ticket
.
getReference
()
+
" Justificatif"
,
description
=
ticket
.
getDescription
(),
filename
=
"tmp.png"
,
follow_up
=
ticket
.
getRelativeUrl
(),
publication_section
=
portal
.
ERP5Site_getPreferredExpenseDocumentPublicationSectionValue
().
getRelativeUrl
(),
)
image
.
share
()
else
:
print
ticket
.
getRelativeUrl
()
print
DateTime
()
#return printed
for
i
in
context
.
portal_catalog
(
portal_type
=
'Expense Validation Request'
):
for
i
in
context
.
portal_catalog
(
portal_type
=
'Expense Validation Request'
):
sourceReference
=
i
.
getSourceReference
()
sourceReference
=
i
.
getSourceReference
()
if
sourceReference
:
if
sourceReference
:
...
...
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