...
 
......@@ -344,75 +344,6 @@
<td>//button[text()="Action succeeded."]</td>
<td></td>
</tr>
<!-- Check in ERP5: New Event -->
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='field_my_title']</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Actions'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text() = 'New Event']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text() = 'New Event']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='action_confirm' and @value='Create Event']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@name='action_confirm' and @value='Create Event']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[text()="Action succeeded."]</td>
<td></td>
</tr>
<!-- Check in ERP5: New Expense -->
<tr>
<td>waitForElementPresent</td>
<td>//label[@for='field_my_title']</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Actions'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_header_link" />
</tal:block>
<tr>
<td>waitForElementPresent</td>
<td>//a[text() = 'New Expense']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//a[text() = 'New Expense']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//input[@name='action_confirm' and @value='Create Expense']</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//input[@name='action_confirm' and @value='Create Expense']</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//button[text()="Action succeeded."]</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/Zuite_waitForActivities</td>
......
import base64
portal = context.getPortalObject()
expense_record_module = portal.getDefaultModule('Expense Record')
#sender = portal.ERP5Site_getAuthenticatedMemberPersonValue()
sender = portal.portal_membership.getAuthenticatedMember().getUser()
image_url = context.getUrl()
expense_validation_request = expense_record_module.newContent(
sender = portal.portal_membership.getAuthenticatedMember().getUserValue()
data = context.getData()
data64 = u''.join(base64.encodestring(data).splitlines())
photo_data = u'data:%s;base64,%s' % ("image/*", data64)
expense_record = expense_record_module.newContent(
comment=comment,
resource_title=currency,
quantity=quantity,
source_value=sender,
date=date,
image=image_url,
source_value=sender,
photo_data=photo_data,
portal_type='Expense Record')