Commit 8c1715ea authored by Cédric Le Ninivin's avatar Cédric Le Ninivin Committed by Xiaowu Zhang

erp5_travel_expense: Add support For Leave Request

parent 8b20234f
......@@ -77,7 +77,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Event_view</string> </value>
<value> <string>string:${object_url}/LeaveRequestRecord_view</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -269,9 +269,9 @@
type: "replicate",
// XXX This drop the signature lists...
query: {
query: '(portal_type: "Expense Record" AND simulation_state:("draft","sent","stopped"))' +
query: '(portal_type: "Expense Record" AND simulation_state:("draft","sent","stopped")) ' +
'OR (portal_type: "Travel Request Record" AND simulation_state:("draft","sent","stopped")) ' +
'OR (portal_type: "Leave Request Record" AND validation_state:"draft") ' +
'OR (portal_type: "Leave Request Record" AND simulation_state:("draft","sent","stopped")) ' +
'OR (portal_type: "Currency" AND validation_state:"validated") ' +
'OR (portal_type: "Service" AND validation_state:"validated") ' +
'OR (portal_type: "Person" AND id: "' + me.split("/")[1] + '")',
......
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.8604.31177.32494</string> </value>
<value> <string>956.8685.14094.36198</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1482421272.85</float>
<float>1482921657.76</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -48,10 +48,8 @@
gadget.props.translation_dict["Not synced!"];
} else {
result.data.rows[i].value.state =
gadget.props.translation_dict[
result.data.rows[i].value.local_state ||
"Waiting for approval"
];
result.data.rows[i].value.state || gadget.props.translation_dict[
"Waiting for approval"];
}
}
return result;
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.41044.23169.2781</string> </value>
<value> <string>956.4266.40527.32802</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1480588811.4</float>
<float>1482923348.1</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -74,8 +74,8 @@
date_text = date.getFullYear()+('0'+(date.getMonth()+1)).slice(-2)+('0'+date.getDate()).slice(-2);
return new RSVP.Queue()
.push(function () {
if (gadget.options.doc.doc_id) {
return gadget.options.doc.doc_id;
if (gadget.options.doc.source_reference) {
return gadget.options.doc.source_reference;
} else {
return new RSVP.Queue()
.push(function () {
......@@ -201,7 +201,7 @@
not_sync_checked = 'checked';
}
ops = {
state: sync_state,
state: options.doc.state || sync_state,
start_date: options.doc.start_date|| new Date().toISOString().slice(0,10),
stop_date: options.doc.stop_date|| new Date().toISOString().slice(0,10),
quantity: options.doc.quantity,
......@@ -219,7 +219,7 @@
gadget.props.element.innerHTML = html;
return gadget.updateHeader({
title: gadget.options.jio_key + " " + (gadget.options.doc.record_revision || 1),
title: "Demande de congé",
save_action: sync_state === 'Synced'? false: true
});
})
......@@ -335,15 +335,13 @@
'submit',
false,
function (submit_event) {
return getSequentialID(gadget, 'EXP')
.push(function (doc_id) {
return getSequentialID(gadget, 'LRR')
.push(function (source_reference) {
var i,
doc = {
parent_relative_url: "record_module",
portal_type: "Leave Request Record",
doc_id: doc_id,
visible_in_html5_app_flag: 1,
record_revision: (gadget.options.doc.record_revision || 1),
source_reference: source_reference,
modification_date: new Date().toISOString()
};
for (i = 0; i < submit_event.target.length; i += 1) {
......@@ -364,7 +362,7 @@
}
if (doc.sync_flag === "1"){
sync = 1;
doc.validation_state = 'draft'
doc.simulation_state = 'draft'
}
return gadget.put(gadget.options.jio_key, doc);
})
......
......@@ -244,7 +244,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.41031.64277.45516</string> </value>
<value> <string>956.17061.57868.19302</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>1480516694.26</float>
<float>1482923877.99</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -36,7 +36,7 @@
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string>TicketRecord_init</string> </value>
<value> <string>Ticket_init</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
......
......@@ -36,7 +36,7 @@
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string>TicketRecord_init</string> </value>
<value> <string>Ticket_init</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
......
......@@ -7,6 +7,14 @@
<type>Expense Validation Request</type>
<workflow>edit_workflow, pricing_interaction_workflow, ticket_acceptance_simulation_workflow, ticket_interaction_workflow, ticket_record_interaction_workflow</workflow>
</chain>
<chain>
<type>Leave Request</type>
<workflow>ticket_record_interaction_workflow</workflow>
</chain>
<chain>
<type>Leave Request Period</type>
<workflow>ticket_record_interaction_workflow</workflow>
</chain>
<chain>
<type>Leave Request Record</type>
<workflow>document_conversion_interaction_workflow, edit_workflow, event_interaction_workflow, event_simulation_workflow, pricing_interaction_workflow, validation_workflow</workflow>
......
portal = context.getPortalObject()
portal.portal_catalog.searchAndActivate(
portal_type="Leave Request Record",
simulation_state=["draft"],
method_id='LeaveRequestRecord_processDraftRecord',
)
portal.portal_catalog.searchAndActivate(
portal_type="Travel Request Record",
simulation_state=["draft"],
method_id='Record_processDraftRecord',
)
portal.portal_catalog.searchAndActivate(
portal_type="Expense Record",
portal_type=(
"Leave Request Record",
"Travel Request Record",
"Expense Record",
),
simulation_state=["draft"],
method_id='Record_processDraftRecord',
)
return context.getParentValue().LeaveRequest_createRepresentativeRecord(record_relative_url)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>record_relative_url=""</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>LeaveRequestPeriod_createRepresentativeRecord</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
portal = context.getPortalObject()
record = context
if record.getDestinationReference() is not None:
ticket_brain_list = portal.portal_catalog(
portal_type="Leave Request",
reference=record.getDestinationReference(),
)
if len(ticket_brain_list) != 1:
raise ValueError("Incorrect number of follow_up ticket found for the Record")
ticket = ticket_brain_list[0].getObject()
else:
# No destination reference means no ticket to track it server side: Create a new one
record.Event_createFollowUpTicket(
follow_up_ticket_title=record.getTitle(),
follow_up_ticket_type="Leave Request",
)
ticket = record.getFollowUpValue()
ticket.setDestination(record.getSource())
ticket.plan()
record.setDestinationReference(ticket.getReference())
record.setFollowUpValue(ticket)
ticket.edit(
title="Cong\xc3\xa9 " + record.getSourceTitle(),
# XXX resource=record.getResource(),
#start_date=DateTime(record.getStartDate()),
#stop_date=DateTime(record.getStopDate()),
#animation_center=record.getSite(),
#travel_destination=record.getDestinationNodeTitle(),
# XX Hackish
description=record.getComment(),
)
line_list = ticket.objectValues(portal_type="Leave Request Period")
if len(line_list) == 0:
line = ticket.newContent(
portal_type="Leave Request Period"
)
elif len(line_list) == 1:
line = line_list[0]
else:
raise ValueError("incorrect number of Leave Request Period in %s" % ticket.getRelativeUrl())
line.edit(
start_date=DateTime(record.getStartDate()),
stop_date=DateTime(record.getStopDate()),
)
record.deliver()
ticket.LeaveRequest_createRepresentativeRecord(
record_relative_url=record.getRelativeUrl()
)
return ticket
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>LeaveRequestRecord_processDraftRecord</string> </value>
<value> <string>LeaveRequestRecord_updateRelatedTicket</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
<string>price (Price)</string>
<string>supplier (Supplier)</string>
<string>product (Product)</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>my_comment</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_reference</string>
<string>my_source_reference</string>
<string>my_start_date</string>
<string>my_stop_date</string>
</list>
</value>
</item>
<item>
<key> <string>price (Price)</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>product (Product)</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_default_follow_up_title</string>
<string>my_source_title</string>
<string>my_translated_portal_type</string>
<string>my_translated_simulation_state_title</string>
</list>
</value>
</item>
<item>
<key> <string>supplier (Supplier)</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>LeaveRequestRecord_view</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>ExpenseRecord_view</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>ERP5 Form</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Leave Request Record</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_copy_of</string> </value>
<value> <string>my_comment</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,11 +71,11 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_string_field</string> </value>
<value> <string>my_description</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_default_follow_up_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_default_follow_up_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>editable</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Source Reference</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>allow_creation</string>
<string>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_source_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>allow_creation</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_event_source_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_photo_data</string> </value>
<value> <string>my_start_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -77,10 +77,6 @@
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......@@ -249,7 +245,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>photo_canvas</string> </value>
<value> <string>Start Date</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_validation_state</string> </value>
<value> <string>my_stop_date</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -77,10 +77,6 @@
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......@@ -249,7 +245,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Resource title</string> </value>
<value> <string>Stop Date</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_translated_portal_type</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_translated_portal_type</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_translated_simulation_state_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_translated_simulation_state_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewCRMFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -76,19 +76,16 @@
<value>
<list>
<string>my_resource</string>
<string>my_quantity</string>
<string>my_stop_date</string>
<string>my_comment</string>
<string>my_sync_flag</string>
<string>my_doc_id</string>
<string>my_copy_of</string>
<string>my_record_revision</string>
<string>my_photo_data</string>
<string>my_visible_in_html5_app_flag</string>
<string>my_source_reference</string>
<string>your_modification_date</string>
<string>my_resource_title</string>
<string>my_start_date</string>
<string>your_validation_state</string>
<string>your_simulation_state</string>
<string>my_title</string>
<string>your_state</string>
<string>my_sync_flag</string>
</list>
</value>
</item>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_doc_id</string> </value>
<value> <string>my_source_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -118,7 +118,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -245,7 +247,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Date</string> </value>
<value> <string>Start Date</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......@@ -265,4 +267,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getStartDate().Date().replace(\'/\',\'-\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -118,7 +118,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -245,7 +247,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Date</string> </value>
<value> <string>Stop Date</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......@@ -265,4 +267,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getStopDate().Date().replace(\'/\',\'-\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -2,13 +2,13 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="IntegerField" module="Products.Formulator.StandardFields"/>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_record_revision</string> </value>
<value> <string>my_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -18,18 +18,14 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>integer_out_of_range</string> </key>
<value> <string>The integer you entered was out of range.</string> </value>
</item>
<item>
<key> <string>not_integer</string> </key>
<value> <string>You did not enter an integer.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -69,10 +65,6 @@
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
......@@ -86,7 +78,7 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -94,11 +86,15 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -144,10 +140,6 @@
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
......@@ -161,7 +153,7 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -169,11 +161,15 @@
<value> <string></string> </value>
</item>
<item>
<key> <string>start</string> </key>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
......@@ -219,10 +215,6 @@
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>end</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
......@@ -239,17 +231,25 @@
<key> <string>input_type</string> </key>
<value> <string>text</string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>start</string> </key>
<value> <string></string> </value>
<key> <string>title</string> </key>
<value> <string>Title</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>my_record_revision</string> </value>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
......
portal = context.getPortalObject()
if not record_relative_url:
record_brain_list = portal.portal_catalog(
portal_type="Leave Request Record",
strict_follow_up_uid=context.getUid(),
simulation_state="stopped",
)
if len(record_brain_list) > 1:
raise ValueError("Number of record superior to one")
elif len(record_brain_list) == 0:
return
record= record_brain_list[0].getObject()
# XXX to be finished
else:
record = portal.restrictedTraverse(record_relative_url)
line_list = context.objectValues(portal_type="Leave Request Period")
if len(line_list) == 1:
line = line_list[0]
else:
raise ValueError("incorrect number of Leave Request Period in %s" % context.getRelativeUrl())
new_record = record.Base_createCloneDocument(batch_mode=True)
new_record.edit(
title=context.getTitle(),
destination_reference=context.getReference(),
start_date=line.getStartDate(),
stop_date=line.getStopDate(),
comment=context.getDescription(),
)
new_record.stop()
new_record.Record_archivePreviousVersions()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>record_relative_url=""</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>LeaveRequest_createRepresentativeRecord</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -118,7 +118,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -265,4 +267,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getStartDate().Date().replace(\'/\',\'-\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -118,7 +118,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -265,4 +267,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getStopDate().Date().replace(\'/\',\'-\')</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -19,8 +19,8 @@ new_record = record.Base_createCloneDocument(batch_mode=True)
new_record.edit(
title=context.getTitle(),
destination_reference=context.getReference(),
start_date=context.getStartDate().Date().replace('/','-'),
stop_date=context.getStopDate().Date().replace('/','-'),
start_date=context.getStartDate(),
stop_date=context.getStopDate(),
site=context.getAnimationCenter(),
destination_node_title=context.getTravelDestination(),
# XX Hackish
......
......@@ -59,7 +59,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
<value> <string>user/getUserName</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -60,6 +60,12 @@
<string>validate</string>
<string>suspend</string>
<string>invalidate</string>
<string>plan</string>
<string>confirm</string>
<string>reject</string>
<string>approve</string>
<string>accept</string>
<string>cancel</string>
</list>
</value>
</item>
......@@ -73,6 +79,7 @@
<list>
<string>Expense Validation Request</string>
<string>Leave Request</string>
<string>Leave Request Period</string>
<string>Travel Request</string>
</list>
</value>
......
erp5_accounting
erp5_crm
erp5_calendar
erp5_web_renderjs_ui
erp5_officejs
\ No newline at end of file
......@@ -9,12 +9,14 @@ Expense Validation Request | pricing_interaction_workflow
Expense Validation Request | ticket_acceptance_simulation_workflow
Expense Validation Request | ticket_interaction_workflow
Expense Validation Request | ticket_record_interaction_workflow
Leave Request Period | ticket_record_interaction_workflow
Leave Request Record | document_conversion_interaction_workflow
Leave Request Record | edit_workflow
Leave Request Record | event_interaction_workflow
Leave Request Record | event_simulation_workflow
Leave Request Record | pricing_interaction_workflow
Leave Request Record | validation_workflow
Leave Request | ticket_record_interaction_workflow
Record Module | edit_workflow
Record Module | validation_workflow
Travel Request Record | document_conversion_interaction_workflow
......
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