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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
b64c770c
Commit
b64c770c
authored
Dec 29, 2016
by
Cédric Le Ninivin
Committed by
Xiaowu Zhang
Dec 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_travel_expense: Add interaction to create Purchase Invoice Transaction on accept
parent
79960ff2
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
556 additions
and
1 deletion
+556
-1
bt5/erp5_travel_expense/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+1
-1
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ERP5Site_getPreferredExpenseAccountTuple.py
...p5_hr_request/ERP5Site_getPreferredExpenseAccountTuple.py
+5
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ERP5Site_getPreferredExpenseAccountTuple.xml
...5_hr_request/ERP5Site_getPreferredExpenseAccountTuple.xml
+62
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_acceptExpense.py
...erp5_hr_request/ExpenseValidationRequest_acceptExpense.py
+11
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_acceptExpense.xml
...rp5_hr_request/ExpenseValidationRequest_acceptExpense.xml
+62
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_createPurchaseTransaction.py
...est/ExpenseValidationRequest_createPurchaseTransaction.py
+40
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_createPurchaseTransaction.xml
...st/ExpenseValidationRequest_createPurchaseTransaction.xml
+62
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow.xml
...kflow/expense_validation_request_interaction_workflow.xml
+46
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/interactions.xml
..._validation_request_interaction_workflow/interactions.xml
+28
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/interactions/ExpenseValidationRequest_accept.xml
...workflow/interactions/ExpenseValidationRequest_accept.xml
+102
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/scripts.xml
...pense_validation_request_interaction_workflow/scripts.xml
+28
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/scripts/ExpenseValidationRequest_accept.py
...ction_workflow/scripts/ExpenseValidationRequest_accept.py
+1
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/scripts/ExpenseValidationRequest_accept.xml
...tion_workflow/scripts/ExpenseValidationRequest_accept.xml
+62
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/variables.xml
...nse_validation_request_interaction_workflow/variables.xml
+22
-0
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/worklists.xml
...nse_validation_request_interaction_workflow/worklists.xml
+22
-0
bt5/erp5_travel_expense/bt/template_portal_type_workflow_chain_list
...ravel_expense/bt/template_portal_type_workflow_chain_list
+1
-0
bt5/erp5_travel_expense/bt/template_workflow_id_list
bt5/erp5_travel_expense/bt/template_workflow_id_list
+1
-0
No files found.
bt5/erp5_travel_expense/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
b64c770c
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
</chain>
</chain>
<chain>
<chain>
<type>
Expense Validation Request
</type>
<type>
Expense Validation Request
</type>
<workflow>
edit_workflow, pricing_interaction_workflow, ticket_acceptance_simulation_workflow, ticket_interaction_workflow, ticket_record_interaction_workflow
</workflow>
<workflow>
edit_workflow,
expense_validation_request_interaction_workflow,
pricing_interaction_workflow, ticket_acceptance_simulation_workflow, ticket_interaction_workflow, ticket_record_interaction_workflow
</workflow>
</chain>
</chain>
<chain>
<chain>
<type>
Leave Request
</type>
<type>
Leave Request
</type>
...
...
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ERP5Site_getPreferredExpenseAccountTuple.py
0 → 100644
View file @
b64c770c
# To be overwritten for each project
# account_module = context.getPortalObject()
# return 'account_module/pcg_6251', 'account_module/pcg_401'
# return mission_account, debt_account
return
''
,
''
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ERP5Site_getPreferredExpenseAccountTuple.xml
0 → 100644
View file @
b64c770c
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_getPreferredExpenseAccountTuple
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_acceptExpense.py
0 → 100644
View file @
b64c770c
portal
=
context
.
getPortalObject
()
state
=
context
.
getSimulationState
()
if
state
==
"validated"
:
return
if
(
state
not
in
(
'accepted'
)):
return
context
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
portal
.
Base_translateString
(
"Transaction is not in the right state"
,),))
context
.
ExpenseValidationRequest_createPurchaseTransaction
()
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_acceptExpense.xml
0 → 100644
View file @
b64c770c
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ExpenseValidationRequest_acceptExpense
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_createPurchaseTransaction.py
0 → 100644
View file @
b64c770c
portal
=
context
.
getPortalObject
()
state
=
context
.
getSimulationState
()
if
(
state
not
in
(
'accepted'
)):
from
zExceptions
import
Unauthorized
raise
Unauthorized
mission_account
,
debt_account
=
portal
.
ERP5Site_getPreferredExpenseAccountTuple
()
if
not
mission_account
:
context
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
portal
.
Base_translateString
(
"No Account has been defined for Expenses Transactions"
,
),
)
)
transaction
=
portal
.
accounting_module
.
newContent
(
portal_type
=
"Purchase Invoice Transaction"
,
title
=
"""Frais %s"""
%
(
context
.
getReference
()),
source_section
=
context
.
getDestinationDecision
(),
source_project
=
context
.
getSourceProject
(),
destination_section
=
context
.
getDestinationSection
(),
resource
=
context
.
getPriceCurrency
(),
created_by_builder
=
1
,
# XXX this prevent init script from creating lines.
start_date
=
DateTime
().
earliestTime
(),
)
transaction
.
newContent
(
portal_type
=
'Purchase Invoice Transaction Line'
,
destination
=
mission_account
,
quantity
=
(
float
(
context
.
getTotalPrice
())),
)
transaction
.
newContent
(
portal_type
=
'Purchase Invoice Transaction Line'
,
destination
=
debt_account
,
quantity
=
(
-
float
(
context
.
getTotalPrice
())),
)
transaction
.
stop
()
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/ExpenseValidationRequest_createPurchaseTransaction.xml
0 → 100644
View file @
b64c770c
<?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></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ExpenseValidationRequest_createPurchaseTransaction
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow.xml
0 → 100644
View file @
b64c770c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionWorkflowDefinition"
module=
"Products.ERP5.InteractionWorkflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
creation_guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
expense_validation_request_interaction_workflow
</string>
</value>
</item>
<item>
<key>
<string>
manager_bypass
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Expense Validation Request Interaction Workflow
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/interactions.xml
0 → 100644
View file @
b64c770c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interaction"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interactions
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/interactions/ExpenseValidationRequest_accept.xml
0 → 100644
View file @
b64c770c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionDefinition"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</string>
</value>
</item>
<item>
<key>
<string>
actbox_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
activate_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<list>
<string>
ExpenseValidationRequest_accept
</string>
</list>
</value>
</item>
<item>
<key>
<string>
before_commit_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ExpenseValidationRequest_accept
</string>
</value>
</item>
<item>
<key>
<string>
method_id
</string>
</key>
<value>
<list>
<string>
accept
</string>
</list>
</value>
</item>
<item>
<key>
<string>
once_per_transaction
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<list>
<string>
Expense Validation Request
</string>
</list>
</value>
</item>
<item>
<key>
<string>
portal_type_group_filter
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/scripts.xml
0 → 100644
View file @
b64c770c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Scripts"
module=
"Products.DCWorkflow.Scripts"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
scripts
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/scripts/ExpenseValidationRequest_accept.py
0 → 100644
View file @
b64c770c
state_change
[
'object'
].
ExpenseValidationRequest_acceptExpense
()
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/scripts/ExpenseValidationRequest_accept.xml
0 → 100644
View file @
b64c770c
<?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>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ExpenseValidationRequest_accept
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/variables.xml
0 → 100644
View file @
b64c770c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Variables"
module=
"Products.DCWorkflow.Variables"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variables
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/WorkflowTemplateItem/portal_workflow/expense_validation_request_interaction_workflow/worklists.xml
0 → 100644
View file @
b64c770c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Worklists"
module=
"Products.DCWorkflow.Worklists"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
worklists
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/bt/template_portal_type_workflow_chain_list
View file @
b64c770c
...
@@ -5,6 +5,7 @@ Expense Record | event_simulation_workflow
...
@@ -5,6 +5,7 @@ Expense Record | event_simulation_workflow
Expense Record | event_simulation_workflow
Expense Record | event_simulation_workflow
Expense Record | pricing_interaction_workflow
Expense Record | pricing_interaction_workflow
Expense Validation Request | edit_workflow
Expense Validation Request | edit_workflow
Expense Validation Request | expense_validation_request_interaction_workflow
Expense Validation Request | pricing_interaction_workflow
Expense Validation Request | pricing_interaction_workflow
Expense Validation Request | ticket_acceptance_simulation_workflow
Expense Validation Request | ticket_acceptance_simulation_workflow
Expense Validation Request | ticket_interaction_workflow
Expense Validation Request | ticket_interaction_workflow
...
...
bt5/erp5_travel_expense/bt/template_workflow_id_list
View file @
b64c770c
expense_validation_request_interaction_workflow
ticket_acceptance_simulation_workflow
ticket_acceptance_simulation_workflow
ticket_record_interaction_workflow
ticket_record_interaction_workflow
\ No newline at end of file
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