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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
erp5
Commits
b0ba614f
Commit
b0ba614f
authored
Apr 21, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
payroll: pylint py3
parent
19120074
Changes
2
Show 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 @
b0ba614f
...
@@ -9,12 +9,9 @@
...
@@ -9,12 +9,9 @@
from
Products.ERP5Type.Utils
import
cartesianProduct
from
Products.ERP5Type.Utils
import
cartesianProduct
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Message
import
translateString
def
sortByIntIndex
(
a
,
b
):
return
cmp
(
a
.
getIntIndex
(),
b
.
getIntIndex
())
portal_type_list
=
[
'Pay Sheet Model Line'
]
portal_type_list
=
[
'Pay Sheet Model Line'
]
sub_object_list
=
context
.
getInheritedObjectValueList
(
portal_type_list
)
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
model_line_list
=
sub_object_list
# remove editable model line
# remove editable model line
...
@@ -117,37 +114,16 @@ if batch_mode:
...
@@ -117,37 +114,16 @@ if batch_mode:
return
object_dict_list
return
object_dict_list
# sort results
# 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
:
if
'sort_on'
in
kw
:
sort_on
=
kw
[
'sort_on'
]
sort_on
=
kw
[
'sort_on'
]
if
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'ascending'
:
if
sort_on
[
0
][
0
]
==
'title'
:
line_list
.
sort
(
sortByTitleAscending
)
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getTitle
()
or
''
,
reverse
=
sort_on
[
0
][
1
]
==
'ascending'
)
elif
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'descending'
:
elif
sort_on
[
0
][
0
]
==
'int_index'
:
line_list
.
sort
(
sortByTitleDescending
)
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getIntIndex
()
or
0
,
reverse
=
sort_on
[
0
][
1
]
==
'ascending'
)
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
)
else
:
else
:
line_list
.
sort
(
sortByDefaultSortMethod
)
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getIntIndex
()
)
else
:
else
:
line_list
.
sort
(
sortByDefaultSortMethod
)
line_list
=
sorted
(
line_list
,
key
=
lambda
x
:
x
.
getIntIndex
())
#return pprint.pformat(line_list)
#return pprint.pformat(line_list)
return
line_list
return
line_list
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getODTDataDict.py
View file @
b0ba614f
...
@@ -115,7 +115,7 @@ def unicodeDict(d):
...
@@ -115,7 +115,7 @@ def unicodeDict(d):
return
d
return
d
for
k
,
v
in
six
.
iteritems
(
d
):
for
k
,
v
in
six
.
iteritems
(
d
):
if
isinstance
(
v
,
str
):
if
isinstance
(
v
,
str
):
d
.
update
({
k
:
unicod
e
(
v
,
'utf8'
)})
d
.
update
({
k
:
six
.
text_typ
e
(
v
,
'utf8'
)})
return
d
return
d
line_list
=
context
.
PaySheetTransaction_getLineListAsDict
()
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