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
141
Merge Requests
141
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
12672876
Commit
12672876
authored
Jun 06, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
payroll: address pylint warnings and enable coding style test
parent
931ab2ce
Pipeline
#21952
failed with stage
in 0 seconds
Changes
19
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
56 additions
and
100 deletions
+56
-100
bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.py
...Item/portal_components/document.erp5.PaySheetModelLine.py
+1
-1
bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.xml
...tem/portal_components/document.erp5.PaySheetModelLine.xml
+1
-3
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_getNetSalaryReportSectionLineList.py
...ingTransactionModule_getNetSalaryReportSectionLineList.py
+0
-1
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetLine_asCellRange.py
...tem/portal_skins/erp5_payroll/PaySheetLine_asCellRange.py
+4
-4
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetModelLine_asCellRange.py
...ortal_skins/erp5_payroll/PaySheetModelLine_asCellRange.py
+1
-1
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_checkParameters.py
...skins/erp5_payroll/PaySheetTransaction_checkParameters.py
+0
-1
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_copySubObject.xml
..._skins/erp5_payroll/PaySheetTransaction_copySubObject.xml
+1
-1
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_createAllPaySheetLineList.py
..._payroll/PaySheetTransaction_createAllPaySheetLineList.py
+0
-1
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_createAllPaySheetLineList.xml
...payroll/PaySheetTransaction_createAllPaySheetLineList.xml
+1
-1
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.py
..._payroll/PaySheetTransaction_getEditableObjectLineList.py
+13
-19
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getLineListAsDict.py
...ins/erp5_payroll/PaySheetTransaction_getLineListAsDict.py
+2
-2
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementList.py
...skins/erp5_payroll/PaySheetTransaction_getMovementList.py
+16
-23
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getODTDataDict.py
..._skins/erp5_payroll/PaySheetTransaction_getODTDataDict.py
+0
-10
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateBaseContributionTotalPrice.py
...eetTransaction_getYearToDateBaseContributionTotalPrice.py
+2
-2
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_printAsODT.py
...rtal_skins/erp5_payroll/PaySheetTransaction_printAsODT.py
+1
-0
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/Person_getCareerRecord.py
...eItem/portal_skins/erp5_payroll/Person_getCareerRecord.py
+3
-3
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py
...stTemplateItem/portal_components/test.erp5.testPayroll.py
+9
-18
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.xml
...tTemplateItem/portal_components/test.erp5.testPayroll.xml
+1
-8
bt5/erp5_payroll/bt/skip_coding_style_test
bt5/erp5_payroll/bt/skip_coding_style_test
+0
-1
No files found.
bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.py
View file @
12672876
...
...
@@ -66,7 +66,7 @@ class PaySheetModelLine(TradeModelLine):
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'newCellContent'
)
def
newCellContent
(
self
,
id
,
portal_type
=
'Pay Sheet Model Cell'
,
**
kw
):
def
newCellContent
(
self
,
id
,
portal_type
=
'Pay Sheet Model Cell'
,
**
kw
):
# pylint:disable=redefined-builtin
"""Overriden to specify default portal type
"""
return
self
.
newContent
(
id
=
id
,
portal_type
=
portal_type
,
**
kw
)
bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.xml
View file @
12672876
...
...
@@ -37,9 +37,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 69, 27: Redefining built-in \'id\' (redefined-builtin)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/AccountingTransactionModule_getNetSalaryReportSectionLineList.py
View file @
12672876
...
...
@@ -3,7 +3,6 @@ from DateTime import DateTime
request
=
context
.
REQUEST
portal
=
context
.
getPortalObject
()
translateString
=
portal
.
Base_translateString
net_salary_base_amount_uid
=
\
portal
.
portal_categories
.
base_amount
.
payroll
.
report
.
salary
.
net
.
getUid
()
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetLine_asCellRange.py
View file @
12672876
...
...
@@ -14,20 +14,20 @@ if resource is not None:
for
v
in
base_application_variation_dict
.
values
():
if
matrixbox
==
1
:
cell_range
.
append
(
map
(
lambda
x
:
(
x
[
1
],
x
[
0
]),
v
)
)
cell_range
.
append
(
[(
y
,
x
)
for
x
,
y
in
v
]
)
else
:
cell_range
.
append
(
v
)
else
:
if
matrixbox
==
1
:
# XXX matrixbox is right_display (not as listfield) => invert display and value in item
if
context
.
getVariationCategoryList
(
base_category_list
=
(
base_category
,)):
cell_range
.
append
(
map
(
lambda
x
:
(
x
[
1
],
x
[
0
]),
cell_range
.
append
(
[(
y
,
x
)
for
x
,
y
in
context
.
getVariationCategoryItemList
(
base_category_list
=
\
(
base_category
,)
)
)
)
(
base_category
,)
)
]
)
else
:
cell_range
.
append
(
context
.
getVariationCategoryList
(
base_category_list
=
\
(
base_category
,)))
cell_range
=
filter
(
lambda
x
:
x
!=
[],
cell_range
)
cell_range
=
[
x
for
x
in
cell_range
if
x
]
return
cell_range
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetModelLine_asCellRange.py
View file @
12672876
...
...
@@ -50,7 +50,7 @@ if matrixbox :
%
script
.
id
)
cell_range
.
append
(
category_cell_range
)
cell_range
=
filter
(
lambda
x
:
x
!=
[],
cell_range
)
cell_range
=
[
x
for
x
in
cell_range
if
x
]
while
len
(
cell_range
)
<
3
:
cell_range
.
append
([])
return
cell_range
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_checkParameters.py
View file @
12672876
...
...
@@ -30,7 +30,6 @@ if not employer:
if
not
quantity_unit
:
return
redirect
(
'The work duration unit must be defined'
)
employer_obj
=
paysheet
.
getDestinationSectionValue
()
employee_obj
=
paysheet
.
getSourceSectionValue
()
if
not
employee_obj
.
getCareerGrade
():
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_copySubObject.xml
View file @
12672876
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
portal_type_list=
[]
, property_list=()
</string>
</value>
<value>
<string>
portal_type_list=
()
, property_list=()
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_createAllPaySheetLineList.py
View file @
12672876
...
...
@@ -2,7 +2,6 @@
this script is the conductor. All other scripts that permit to create a
paysheet are called here
'''
import
pprint
# Delete all objects in the paysheet
id_list
=
[]
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_createAllPaySheetLineList.xml
View file @
12672876
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
listbox=
[]
, **kw
</string>
</value>
<value>
<string>
listbox=
()
, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getEditableObjectLineList.py
View file @
12672876
...
...
@@ -7,7 +7,6 @@
"""
from
Products.ERP5Type.Utils
import
cartesianProduct
import
pprint
from
Products.ERP5Type.Message
import
translateString
def
sortByIntIndex
(
a
,
b
):
...
...
@@ -24,7 +23,7 @@ model_line_list = [x.getObject() for x in model_line_list \
line_list
=
[]
object_dict_list
=
[]
id
=
0
id
_
=
0
for
model_line
in
model_line_list
:
base_category_list
=
model_line
.
getVariationBaseCategoryList
()
...
...
@@ -33,24 +32,19 @@ for model_line in model_line_list:
base_application_list
=
', '
.
join
(
translated_base_application_list
)
list_of_list
=
[]
for
base_category
in
base_category_list
:
list
=
model_line
.
getVariationCategoryList
(
base_category_list
=
\
base_category
)
list_of_list
.
append
(
list
)
list_of_list
.
append
(
model_line
.
getVariationCategoryList
(
base_category_list
=
\
base_category
))
cartesian_product
=
cartesianProduct
(
list_of_list
)
previous_share
=
None
object_dict
=
{}
if
cartesian_product
==
[[]]:
share_dict
=
{}
if
0
:
share_dict
[
cell
.
getContributionShare
()
+
'_price'
]
=
0
share_dict
[
cell
.
getContributionShare
()
+
'_quantity'
]
=
0
continue
for
tuple
in
cartesian_product
:
for
tuple
_
in
cartesian_product
:
share_dict
=
{}
cell
=
model_line
.
getCell
(
*
tuple
)
cell
=
model_line
.
getCell
(
*
tuple
_
)
if
cell
is
None
:
continue
...
...
@@ -71,7 +65,7 @@ for model_line in model_line_list:
share_dict
[
cell
.
getContributionShare
()
+
'_quantity'
]
=
quantity
tuple_dict
=
{}
for
item
in
tuple
:
for
item
in
tuple
_
:
# the dict key is the base category and value is the category path
tuple_dict
[
item
.
split
(
'/'
)[
0
]]
=
context
.
portal_categories
.
restrictedTraverse
(
item
).
getTitle
()
tuple_dict
[
item
.
split
(
'/'
)[
0
]
+
'_relative_url'
]
=
item
...
...
@@ -92,8 +86,8 @@ for model_line in model_line_list:
if
tuple_dict
.
has_key
(
'salary_range'
):
salary_range_title
=
tuple_dict
[
'salary_range'
]
salary_range_relative_url
=
tuple_dict
[
'salary_range_relative_url'
]
new_uid
=
"new_%s"
%
id
id
+=
1
new_uid
=
"new_%s"
%
id
_
id
_
+=
1
object_dict
[
salary_range
]
=
{
'uid'
:
new_uid
,
'salary_range_title'
:
salary_range_title
,
...
...
@@ -139,14 +133,14 @@ def sortByIntIndexDescending(x, y):
sortByDefaultSortMethod
=
sortByIntIndexAscending
if
kw
.
has_key
(
'sort_on'
):
list
=
kw
[
'sort_on'
]
if
list
[
0
][
0
]
==
'title'
and
list
[
0
][
1
]
==
'ascending'
:
sort_on
=
kw
[
'sort_on'
]
if
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'ascending'
:
line_list
.
sort
(
sortByTitleAscending
)
elif
list
[
0
][
0
]
==
'title'
and
list
[
0
][
1
]
==
'descending'
:
elif
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'descending'
:
line_list
.
sort
(
sortByTitleDescending
)
elif
list
[
0
][
0
]
==
'int_index'
and
list
[
0
][
1
]
==
'ascending'
:
elif
sort_on
[
0
][
0
]
==
'int_index'
and
sort_on
[
0
][
1
]
==
'ascending'
:
line_list
.
sort
(
sortByIntIndexAscending
)
elif
list
[
0
][
0
]
==
'int_index'
and
list
[
0
][
1
]
==
'descending'
:
elif
sort_on
[
0
][
0
]
==
'int_index'
and
sort_on
[
0
][
1
]
==
'descending'
:
line_list
.
sort
(
sortByIntIndexDescending
)
else
:
line_list
.
sort
(
sortByDefaultSortMethod
)
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getLineListAsDict.py
View file @
12672876
...
...
@@ -5,8 +5,8 @@
line_list
=
context
.
PaySheetTransaction_getMovementList
(
sort_on
=
[(
'int_index'
,
'ascending'
)])
def
addProperties
(
line
,
line_dict
,
property_list
):
for
prop
erty
in
property_list
:
line_dict
[
prop
erty
]
=
getattr
(
line
,
property
,
None
)
for
prop
in
property_list
:
line_dict
[
prop
]
=
getattr
(
line
,
prop
,
None
)
return
line_dict
line_dict_list
=
[]
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getMovementList.py
View file @
12672876
...
...
@@ -7,10 +7,9 @@
from
Products.ERP5Type.Utils
import
cartesianProduct
import
pprint
from
Products.ERP5Type.Message
import
translateString
portal
=
context
.
getPortalObject
()
;
portal
=
context
.
getPortalObject
()
paysheet_line_list
=
context
.
contentValues
(
portal_type
=
(
'Pay Sheet Line'
,
'Pay Sheet Model Line'
))
if
context
.
getPriceCurrencyValue
()
is
not
None
:
precision
=
context
.
getPriceCurrencyValue
().
getQuantityPrecision
()
...
...
@@ -35,14 +34,11 @@ for paysheet_line in paysheet_line_list:
list_of_list
=
[]
for
base_category
in
base_category_list
:
list
=
paysheet_line
.
getVariationCategoryList
(
base_category_list
=
\
base_category
)
list_of_list
.
append
(
list
)
list
_of_list
.
append
(
paysheet_line
.
getVariationCategoryList
(
base_category_list
=
\
base_category
)
)
cartesian_product
=
cartesianProduct
(
list_of_list
)
previous_share
=
None
indice
=
0
if
cartesian_product
==
[[]]
or
cartesian_product
==
[]:
params
=
{
'base'
:
paysheet_line
.
getTotalPrice
(),
...
...
@@ -56,7 +52,6 @@ for paysheet_line in paysheet_line_list:
object_dict
=
{}
for
product
in
cartesian_product
:
indice
+=
1
share_dict
=
{}
cell
=
paysheet_line
.
getCell
(
base_id
=
'movement'
,
*
product
)
if
cell
is
None
:
...
...
@@ -80,14 +75,14 @@ for paysheet_line in paysheet_line_list:
# we want to display as lines as a paysheet line as slices
# this is easier to read
slice
=
cell
.
getSalaryRange
()
if
slice
is
None
:
slice
=
'no_slice'
if
not
object_dict
.
has_key
(
slice
):
s
alary_range_s
lice
=
cell
.
getSalaryRange
()
if
s
alary_range_s
lice
is
None
:
s
alary_range_s
lice
=
'no_slice'
if
not
object_dict
.
has_key
(
s
alary_range_s
lice
):
slice_title
=
None
if
tuple_dict
.
has_key
(
'salary_range'
):
slice_title
=
tuple_dict
[
'salary_range'
]
object_dict
[
slice
]
=
{
object_dict
[
s
alary_range_s
lice
]
=
{
'slice'
:
slice_title
,
'base_name'
:
base_name
,
'base'
:
base
,
...
...
@@ -96,9 +91,9 @@ for paysheet_line in paysheet_line_list:
'service'
:
service
is
not
None
and
\
service
.
getId
()
or
''
,
'causality'
:
causality
,}
object_dict
[
slice
].
update
(
share_dict
)
object_dict
[
s
alary_range_s
lice
].
update
(
share_dict
)
else
:
object_dict
[
slice
].
update
(
**
share_dict
)
object_dict
[
s
alary_range_s
lice
].
update
(
**
share_dict
)
if
not
object_dict
:
# when the variation categories are set, but no cells.
...
...
@@ -120,8 +115,6 @@ for paysheet_line in paysheet_line_list:
line_list
.
append
(
paysheet_line
.
asContext
(
**
params
))
continue
# print pprint.pformat(object_dict)
for
object_key
in
paysheet_line
.
getSalaryRangeList
():
line_list
.
append
(
paysheet_line
.
asContext
(
**
object_dict
[
object_key
]))
if
object_dict
.
has_key
(
'no_slice'
):
...
...
@@ -145,14 +138,14 @@ def sortByIntIndexDescending(x, y):
sortByDefaultSortMethod
=
sortByIntIndexAscending
if
kw
.
has_key
(
'sort_on'
):
list
=
kw
[
'sort_on'
]
if
list
[
0
][
0
]
==
'title'
and
list
[
0
][
1
]
==
'ascending'
:
sort_on
=
kw
[
'sort_on'
]
if
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'ascending'
:
line_list
.
sort
(
sortByTitleAscending
)
elif
list
[
0
][
0
]
==
'title'
and
list
[
0
][
1
]
==
'descending'
:
elif
sort_on
[
0
][
0
]
==
'title'
and
sort_on
[
0
][
1
]
==
'descending'
:
line_list
.
sort
(
sortByTitleDescending
)
elif
list
[
0
][
0
]
==
'int_index'
and
list
[
0
][
1
]
==
'ascending'
:
elif
sort_on
[
0
][
0
]
==
'int_index'
and
sort_on
[
0
][
1
]
==
'ascending'
:
line_list
.
sort
(
sortByIntIndexAscending
)
elif
list
[
0
][
0
]
==
'int_index'
and
list
[
0
][
1
]
==
'descending'
:
elif
sort_on
[
0
][
0
]
==
'int_index'
and
sort_on
[
0
][
1
]
==
'descending'
:
line_list
.
sort
(
sortByIntIndexDescending
)
else
:
line_list
.
sort
(
sortByDefaultSortMethod
)
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getODTDataDict.py
View file @
12672876
translateString
=
context
.
Base_translateString
specialise_value
=
context
.
getSpecialiseValue
()
def
getFieldAsString
(
field
):
...
...
@@ -12,14 +11,6 @@ def getFieldAsLineList(field):
text_list
=
text
.
split
(
'
\
n
'
)
return
[
x
for
x
in
text_list
if
x
]
def
getProductAndLineDesc
(
prod_desc
,
line_desc
):
line_list
=
[]
if
line_desc
:
line_list
.
extend
(
getFieldAsLineList
(
line_desc
))
elif
prod_desc
:
line_list
.
extend
(
getFieldAsLineList
(
prod_desc
))
return
line_list
def
getOneLineAddress
(
text
,
region
):
text_list
=
[
getFieldAsString
(
text
)]
if
region
:
...
...
@@ -117,7 +108,6 @@ def getSocialOrganisationValue():
line_list
=
[]
total_price
=
0.0
total_vat
=
0.0
def
unicodeDict
(
d
):
for
k
,
v
in
d
.
items
():
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_getYearToDateBaseContributionTotalPrice.py
View file @
12672876
...
...
@@ -8,7 +8,7 @@
# are not in stock table due to the lack of source/destination definition
if
paysheet
is
None
:
paysheet
=
context
paysheet
=
context
# test the list parameters
if
base_contribution_list
is
None
:
...
...
@@ -17,7 +17,7 @@ elif not (same_type(base_contribution_list, []) or
same_type
(
base_contribution_list
,
())):
base_contribution_list
=
[
base_contribution_list
]
portal
=
context
.
getPortalObject
()
;
portal
=
context
.
getPortalObject
()
portal_simulation
=
portal
.
portal_simulation
base_amount
=
portal
.
portal_categories
.
base_amount
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/PaySheetTransaction_printAsODT.py
View file @
12672876
# pylint:disable=redefined-builtin
if
target_language
:
container
.
REQUEST
[
'AcceptLanguage'
].
set
(
target_language
,
10
)
...
...
bt5/erp5_payroll/SkinTemplateItem/portal_skins/erp5_payroll/Person_getCareerRecord.py
View file @
12672876
...
...
@@ -4,10 +4,10 @@
portal
=
context
.
getObject
()
organisation_module
=
portal
.
getDefaultModuleValue
(
"Organisation"
)
def
getObjectOrRaise
(
module
,
id
):
obj
=
getattr
(
module
,
id
,
None
)
def
getObjectOrRaise
(
module
,
object_
id
):
obj
=
getattr
(
module
,
object_
id
,
None
)
if
obj
is
None
:
raise
AttributeError
(
"%s doesn't have sub-object with id %s"
%
(
module
,
id
))
raise
AttributeError
(
"%s doesn't have sub-object with id %s"
%
(
module
,
object_
id
))
else
:
return
obj
...
...
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py
View file @
12672876
...
...
@@ -28,7 +28,6 @@
##############################################################################
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5ReportTestCase
from
erp5.component.test.testTradeModelLine
import
TestTradeModelLineMixin
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.Sequence
import
SequenceList
from
Products.ERP5Type.tests.utils
import
reindex
from
DateTime
import
DateTime
...
...
@@ -148,13 +147,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
self
.
portal
.
business_process_module
.
manage_delObjects
(
list
([
x
for
x
in
self
.
portal
.
business_process_module
.
objectIds
()
if
x
!=
"erp5_default_business_process"
]))
def
login
(
self
):
uf
=
self
.
getPortal
().
acl_users
uf
.
_doAddUser
(
'admin'
,
''
,
[
'Manager'
,
'Assignee'
,
'Assignor'
,
'Associate'
,
'Auditor'
,
'Author'
],
[])
user
=
uf
.
getUserById
(
'admin'
).
__of__
(
uf
)
newSecurityManager
(
None
,
user
)
@
reindex
def
createCategories
(
self
):
"""Create the categories for our test. """
...
...
@@ -328,10 +320,12 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
)
sequence
.
edit
(
model
=
model
)
def
addSlice
(
self
,
model
,
slice
,
min_value
,
max_value
,
base_id
=
'cell'
):
def
addSlice
(
self
,
model
,
paysheet_model_
slice
,
min_value
,
max_value
,
base_id
=
'cell'
):
'''add a new slice in the model'''
slice_value
=
model
.
newCell
(
slice
,
portal_type
=
'Pay Sheet Model Slice'
,
base_id
=
base_id
)
slice_value
=
model
.
newCell
(
paysheet_model_slice
,
portal_type
=
'Pay Sheet Model Slice'
,
base_id
=
base_id
)
slice_value
.
setQuantityRangeMax
(
max_value
)
slice_value
.
setQuantityRangeMin
(
min_value
)
return
slice_value
...
...
@@ -588,7 +582,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
expected_movement_to_delete_count
,
expected_movement_to_add_count
):
movement_dict
=
paysheet
.
updateAggregatedAmountList
()
movement_to_delete
=
movement_dict
[
'movement_to_delete_list'
]
movement_to_add
=
movement_dict
[
'movement_to_add_list'
]
#
movement_to_add = movement_dict['movement_to_add_list']
self
.
assertEqual
(
len
(
movement_to_delete
),
expected_movement_to_delete_count
)
# self.assertEqual(len(movement_to_add), expected_movement_to_add_count)
...
...
@@ -1540,7 +1534,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
portal_type_list
=
[
'Pay Sheet Model Line'
,]
# if no reference, we don't care about dates
sub_object_list
=
paysheet
.
getInheritedObjectValueList
(
portal_type_list
)
paysheet
.
getInheritedObjectValueList
(
portal_type_list
)
self
.
assertEqual
(
len
(
paysheet
.
contentValues
(
\
portal_type
=
'Pay Sheet Line'
)),
0
)
...
...
@@ -1607,8 +1601,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
paysheet_with_date
.
PaySheetTransaction_applyModel
()
self
.
tic
()
portal_type_list
=
[
'Pay Sheet Model Line'
,]
# check the paysheet contains no lines before calculation
self
.
assertEqual
(
len
(
paysheet_with_date
.
contentValues
(
\
portal_type
=
'Pay Sheet Line'
)),
0
)
...
...
@@ -1954,9 +1946,8 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
form
=
getattr
(
here
,
report_section
.
getFormId
())
self
.
portal
.
REQUEST
[
'here'
]
=
here
if
form
.
has_field
(
'listbox'
):
result
=
form
.
listbox
.
get_value
(
'default'
,
render_format
=
'list'
,
REQUEST
=
self
.
portal
.
REQUEST
)
form
.
listbox
.
get_value
(
'default'
,
render_format
=
'list'
,
REQUEST
=
self
.
portal
.
REQUEST
)
self
.
assertEqual
(
precision
,
self
.
portal
.
REQUEST
.
get
(
'precision'
))
report_section
.
popReport
(
self
.
portal
)
...
...
bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.xml
View file @
12672876
...
...
@@ -43,14 +43,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:151, 2: Arguments number differs from overridden \'login\' method (arguments-differ)
</string>
<string>
W:331, 28: Redefining built-in \'slice\' (redefined-builtin)
</string>
<string>
W:591, 4: Unused variable \'movement_to_add\' (unused-variable)
</string>
<string>
W:1543, 4: Unused variable \'sub_object_list\' (unused-variable)
</string>
<string>
W:1610, 4: Unused variable \'portal_type_list\' (unused-variable)
</string>
<string>
W:1957, 6: Unused variable \'result\' (unused-variable)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
bt5/erp5_payroll/bt/skip_coding_style_test
deleted
100644 → 0
View file @
931ab2ce
1
\ 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