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
Ludovic Kiefer
erp5
Commits
3c2de7e5
Commit
3c2de7e5
authored
Jan 24, 2017
by
Cédric Le Ninivin
Committed by
Xiaowu Zhang
Jan 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_travel_expense: Add dynamic Leave request type using services
parent
4aad72e4
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
389 additions
and
50 deletions
+389
-50
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.js
...teItem/web_page_module/gadget_hr_leave_request_view_js.js
+34
-41
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.xml
...eItem/web_page_module/gadget_hr_leave_request_view_js.xml
+2
-2
bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/HumanResourcePreference/preferred_leave_request_period_resource_property.xml
...ence/preferred_leave_request_period_resource_property.xml
+44
-0
bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/HumanResourcePreference/preferred_leave_request_period_use_property.xml
...reference/preferred_leave_request_period_use_property.xml
+46
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/LeaveRequestRecord_updateRelatedTicket.py
.../erp5_hr_record/LeaveRequestRecord_updateRelatedTicket.py
+1
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/LeaveRequest_createRepresentativeRecord.py
...erp5_hr_record/LeaveRequest_createRepresentativeRecord.py
+2
-1
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/SystemPreference_viewHumanResource.xml
...ns/erp5_hr_request/SystemPreference_viewHumanResource.xml
+8
-6
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/SystemPreference_viewHumanResource/my_preferred_leave_request_period_resource.xml
...anResource/my_preferred_leave_request_period_resource.xml
+126
-0
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/SystemPreference_viewHumanResource/my_preferred_leave_request_period_use_list.xml
...anResource/my_preferred_leave_request_period_use_list.xml
+126
-0
No files found.
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.js
View file @
3c2de7e5
...
...
@@ -26,6 +26,34 @@
};
function
getResouceSelectList
(
gadget
,
doc
)
{
return
new
RSVP
.
Queue
()
.
push
(
function
(){
return
gadget
.
allDocs
({
query
:
'
portal_type:"Service" AND use:"hr/leave%"
'
,
select_list
:
[
'
relative_url
'
,
'
title
'
],
limit
:
[
0
,
100
]
});
})
.
push
(
function
(
result
)
{
var
i
=
0
,
tmp
,
ops
,
select_options
=
[];
for
(
i
=
0
;
i
<
result
.
data
.
total_rows
;
i
+=
1
)
{
tmp
=
{
title
:
result
.
data
.
rows
[
i
].
value
.
title
,
value
:
result
.
data
.
rows
[
i
].
value
.
relative_url
};
if
(
doc
.
resource
===
result
.
data
.
rows
[
i
].
value
.
relative_url
)
{
tmp
.
is_selected
=
true
;
}
select_options
.
push
(
tmp
);
}
return
select_options
;
});
}
gadget_klass
.
ready
(
function
(
g
)
{
return
g
.
getElement
()
...
...
@@ -64,48 +92,12 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
{
data
:
{
total_rows
:
14
,
rows
:
[
{
title
:
"
Congés Payés Annuels
"
,
relative_url
:
"
1
"
},
{
title
:
"
Congés d'ancienneté
"
,
relative_url
:
"
2
"
},
{
title
:
"
Congé ancienneté demi journée
"
,
relative_url
:
"
3
"
},
{
title
:
"
Congé RTT individuel
"
,
relative_url
:
"
4
"
},
{
title
:
"
Congé révision examen apprenti
"
,
relative_url
:
"
5
"
},
{
title
:
"
Congé naissance adoption
"
,
relative_url
:
"
6
"
},
{
title
:
"
Congé déménagement personnel
"
,
relative_url
:
"
7
"
},
{
title
:
"
Congé Mariage/PACS du salarié
"
,
relative_url
:
"
8
"
},
{
title
:
"
Congé Mariage/PACS famille
"
,
relative_url
:
"
9
"
},
{
title
:
"
Congé Maladie Enfant
"
,
relative_url
:
"
10
"
},
{
title
:
"
Hospitalisation CONJ. Enfant
"
,
relative_url
:
"
11
"
},
{
title
:
"
Amenag. Hor. PDT Grossesse
"
,
relative_url
:
"
12
"
},
{
title
:
"
Congé décès Famille
"
,
relative_url
:
"
13
"
},
{
title
:
"
Congé déménagement mutation
"
,
relative_url
:
"
14
"
},
]
}
}
/*gadget.allDocs({
query: 'portal_type:"Currency"',
select_list: ['relative_url', 'title'],
limit: [0, 100]
});*/
return
getResouceSelectList
(
gadget
,
options
.
doc
);
})
.
push
(
function
(
result
)
{
.
push
(
function
(
select_options
)
{
var
i
=
0
,
tmp
,
ops
,
select_options
=
[];
for
(
i
=
0
;
i
<
result
.
data
.
total_rows
;
i
+=
1
)
{
tmp
=
{
title
:
result
.
data
.
rows
[
i
].
title
,
value
:
result
.
data
.
rows
[
i
].
relative_url
};
if
(
options
.
doc
.
resource
===
result
.
data
.
rows
[
i
].
relative_url
)
{
tmp
.
is_selected
=
true
;
}
select_options
.
push
(
tmp
);
}
ops
;
if
(
options
.
doc
.
sync_flag
===
'
1
'
)
{
sync_checked
=
'
checked
'
;
}
else
{
...
...
@@ -260,9 +252,10 @@
if
((
submit_event
.
target
[
i
].
type
==
"
radio
"
||
submit_event
.
target
[
i
].
type
==
"
checkbox
"
)
&&
!
submit_event
.
target
[
i
].
checked
){
continue
}
if
(
submit_event
.
target
[
i
].
n
ame
===
"
resource
"
){
if
(
submit_event
.
target
[
i
].
n
odeName
===
"
SELECT
"
){
doc
[
submit_event
.
target
[
i
].
name
]
=
submit_event
.
target
[
i
].
value
;
doc
[
"
resource_title
"
]
=
resource_type
[
submit_event
.
target
[
i
].
value
].
title
;
doc
[
submit_event
.
target
[
i
].
name
+
"
_title
"
]
=
submit_event
.
target
[
i
].
options
[
submit_event
.
target
[
i
].
selectedIndex
].
text
;
}
if
(
submit_event
.
target
[
i
].
name
===
"
photo
"
)
{
continue
...
...
bt5/erp5_travel_expense/PathTemplateItem/web_page_module/gadget_hr_leave_request_view_js.xml
View file @
3c2de7e5
...
...
@@ -244,7 +244,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.
44329.14852.21316
</string>
</value>
<value>
<string>
956.
54639.50122.42052
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -262,7 +262,7 @@
</tuple>
<state>
<tuple>
<float>
148
4576839.9
</float>
<float>
148
5178593.24
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/HumanResourcePreference/preferred_leave_request_period_resource_property.xml
0 → 100644
View file @
3c2de7e5
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/lines
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Preferred resource value for Expense Validation Requests
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_leave_request_period_resource_property
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
preference
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<string>
python: []
</string>
</value>
</item>
<item>
<key>
<string>
write_permission
</string>
</key>
<value>
<string>
Manage properties
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/PropertySheetTemplateItem/portal_property_sheets/HumanResourcePreference/preferred_leave_request_period_use_property.xml
0 → 100644
View file @
3c2de7e5
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/lines
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Use values to filter list of resource for Expense Validation Requests
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_leave_request_period_use_property
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
preference
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
write_permission
</string>
</key>
<value>
<string>
Manage properties
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/LeaveRequestRecord_updateRelatedTicket.py
View file @
3c2de7e5
...
...
@@ -46,6 +46,7 @@ else:
line
.
edit
(
start_date
=
DateTime
(
record
.
getStartDate
()),
stop_date
=
DateTime
(
record
.
getStopDate
()),
resource
=
record
.
getResource
(),
)
record
.
deliver
()
...
...
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_record/LeaveRequest_createRepresentativeRecord.py
View file @
3c2de7e5
...
...
@@ -29,7 +29,8 @@ new_record.edit(
start_date
=
line
.
getStartDate
(),
stop_date
=
line
.
getStopDate
(),
comment
=
context
.
getDescription
(),
resource
=
line
.
getResource
(),
resource_tilte
=
line
.
getResourceTitle
(),
)
new_record
.
stop
()
new_record
.
Record_archivePreviousVersions
()
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/SystemPreference_viewHumanResource.xml
View file @
3c2de7e5
...
...
@@ -91,21 +91,23 @@
</item>
<item>
<key>
<string>
left
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list>
<string>
my_preferred_expense_validation_request_use_list
</string>
<string>
my_preferred_expense_validation_request_resource
</string>
<string>
my_preferred_travel_request_use_list
</string>
<string>
my_preferred_travel_request_resource
</string>
<string>
my_preferred_leave_request_period_use_list
</string>
<string>
my_preferred_leave_request_period_resource
</string>
</list>
</value>
</item>
<item>
<key>
<string>
right
</string>
</key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
...
...
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/SystemPreference_viewHumanResource/my_preferred_leave_request_period_resource.xml
0 → 100644
View file @
3c2de7e5
<?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>
items
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_preferred_leave_request_period_resource
</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>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</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_list_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</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>
Preferred Resource for Leave Requests Periods
</string>
</value>
</item>
</dictionary>
</value>
</item>
</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: [(\'\', \'\')] + [(resource.getTitle(), resource.getRelativeUrl()) for resource in here.getPortalObject().portal_catalog(portal_type=here.getPortalObject().getPortalResourceTypeList(), validation_state=\'validated\', use_uid=here.getPortalObject().portal_categories.getCategoryUid(here.getPreference(field.getId().replace(\'my_\', \'\').replace(\'_resource\', \'_use\')), base_category=\'use\'))]
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_travel_expense/SkinTemplateItem/portal_skins/erp5_hr_request/SystemPreference_viewHumanResource/my_preferred_leave_request_period_use_list.xml
0 → 100644
View file @
3c2de7e5
<?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>
items
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_preferred_leave_request_period_use_list
</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>
items
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</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_multi_list_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</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>
Leave Request Period Uses
</string>
</value>
</item>
</dictionary>
</value>
</item>
</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: getattr(here.portal_categories.use, preferences.getPreference(\'preferred_category_child_item_list_method_id\', \'getCategoryChildCompactLogicalPathItemList\'))(local_sort_id=(\'int_index\', \'translated_title\'), checked_permission=\'View\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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