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
Labels
Merge Requests
140
Merge Requests
140
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
f0c30951
Commit
f0c30951
authored
Apr 21, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
payroll: pylint py3
parent
e8596587
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
32 deletions
+8
-32
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.py
..._payroll/PaySheetTransaction_getEditableObjectLineList.py
+7
-31
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getODTDataDict.py
..._skins/erp5_payroll/PaySheetTransaction_getODTDataDict.py
+1
-1
No files found.
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.py
View file @
f0c30951
...
...
@@ -9,12 +9,9 @@
from
Products.ERP5Type.Utils
import
cartesianProduct
from
Products.ERP5Type.Message
import
translateString
def
sortByIntIndex
(
a
,
b
):
return
cmp
(
a
.
getIntIndex
(),
b
.
getIntIndex
())
portal_type_list
=
[
'Pay Sheet Model Line'
]
sub_object_list
=
context
.
getInheritedObjectValueList
(
portal_type_list
)
sub_object_list
.
sort
(
sortByIntIndex
)
sub_object_list
.
sort
(
key
=
lambda
x
:
x
.
getIntIndex
()
)
model_line_list
=
sub_object_list
# remove editable model line
...
...
@@ -117,37 +114,16 @@ if batch_mode:
return
object_dict_list
# sort results
def
sortByTitleAscending
(
x
,
y
):
return
cmp
(
x
.
getTitle
(),
y
.
getTitle
())
def
sortByTitleDescending
(
x
,
y
):
return
cmp
(
y
.
getTitle
(),
x
.
getTitle
())
def
sortByIntIndexAscending
(
x
,
y
):
return
cmp
(
x
.
getIntIndex
(),
y
.
getIntIndex
())
def
sortByIntIndexDescending
(
x
,
y
):
return
cmp
(
y
.
getIntIndex
(),
x
.
getIntIndex
())
sortByDefaultSortMethod
=
sortByIntIndexAscending
if
'sort_on'
in
kw
:
sort_on
=
kw
[
'sort_on'
]
if
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'ascending'
:
line_list
.
sort
(
sortByTitleAscending
)
elif
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'descending'
:
line_list
.
sort
(
sortByTitleDescending
)
elif
sort_on
[
0
][
0
]
==
'int_index'
and
sort_on
[
0
][
1
]
==
'ascending'
:
line_list
.
sort
(
sortByIntIndexAscending
)
elif
sort_on
[
0
][
0
]
==
'int_index'
and
sort_on
[
0
][
1
]
==
'descending'
:
line_list
.
sort
(
sortByIntIndexDescending
)
if
sort_on
[
0
][
0
]
==
'title'
:
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getTitle
()
or
''
,
reverse
=
sort_on
[
0
][
1
]
==
'ascending'
)
elif
sort_on
[
0
][
0
]
==
'int_index'
:
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getIntIndex
()
or
0
,
reverse
=
sort_on
[
0
][
1
]
==
'ascending'
)
else
:
line_list
.
sort
(
sortByDefaultSortMethod
)
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getIntIndex
()
)
else
:
line_list
.
sort
(
sortByDefaultSortMethod
)
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getIntIndex
())
#return pprint.pformat(line_list)
return
line_list
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getODTDataDict.py
View file @
f0c30951
...
...
@@ -115,7 +115,7 @@ def unicodeDict(d):
return
d
for
k
,
v
in
six
.
iteritems
(
d
):
if
isinstance
(
v
,
str
):
d
.
update
({
k
:
unicod
e
(
v
,
'utf8'
)})
d
.
update
({
k
:
six
.
text_typ
e
(
v
,
'utf8'
)})
return
d
line_list
=
context
.
PaySheetTransaction_getLineListAsDict
()
...
...
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