Commit 3ec33714 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_travel_expense: Update migration data for Travel expense

parent 70cf248e
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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment