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
b79c67cf
Commit
b79c67cf
authored
May 16, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: fix used-before-assignment and possibly-used-before-assignment from pylint 3.2.0
parent
8546ac86
Pipeline
#34575
failed with stage
in 0 seconds
Changes
18
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
63 additions
and
46 deletions
+63
-46
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.py
...unting/AccountingTransaction_createReversalTransaction.py
+26
-26
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_addToShoppingCart.py
...ins/erp5_advanced_ecommerce/Resource_addToShoppingCart.py
+1
-0
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_getPriceCalculationDefaultContext.py
...d_ecommerce/Resource_getPriceCalculationDefaultContext.py
+1
-2
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.py
...ins/erp5_base/Person_getPersonDetailedContributionList.py
+2
-0
bt5/erp5_big_file/DocumentTemplateItem/portal_components/document.erp5.BigFile.py
...ntTemplateItem/portal_components/document.erp5.BigFile.py
+4
-3
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.CategoriesSpreadsheetConfiguratorItem.py
...ts/document.erp5.CategoriesSpreadsheetConfiguratorItem.py
+1
-0
bt5/erp5_configurator/ToolComponentTemplateItem/portal_components/tool.erp5.ConfiguratorTool.py
...plateItem/portal_components/tool.erp5.ConfiguratorTool.py
+1
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getFastInputLineList.py
.../portal_skins/erp5_trade/Delivery_getFastInputLineList.py
+1
-1
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_setFastInputLineList.py
.../portal_skins/erp5_trade/Delivery_setFastInputLineList.py
+1
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_updateFastInputLineList.py
...rtal_skins/erp5_trade/Delivery_updateFastInputLineList.py
+1
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_activateGetOrderStatList.py
..._skins/erp5_trade/OrderModule_activateGetOrderStatList.py
+2
-0
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_convertHtmlToSingleFile.py
...tem/portal_skins/erp5_web/Base_convertHtmlToSingleFile.py
+1
-0
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisableItem.py
...Item/portal_components/document.erp5.ImmobilisableItem.py
+2
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
...Item/portal_components/mixin.erp5.AmountGeneratorMixin.py
+1
-1
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.ExpandPolicy.py
...emplateItem/portal_components/module.erp5.ExpandPolicy.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateRelation.py
...plateItem/portal_skins/erp5_core/Base_validateRelation.py
+1
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getModifiableFieldList.py
...kins/erp5_core/BusinessTemplate_getModifiableFieldList.py
+1
-1
product/ERP5Type/patches/pylint_compatibility_disable.py
product/ERP5Type/patches/pylint_compatibility_disable.py
+15
-10
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_createReversalTransaction.py
View file @
b79c67cf
...
...
@@ -64,11 +64,11 @@ line_list = context.AccountingTransaction_getAccountingTransactionLineList(
if
not
cancellation_amount
:
line_list
.
reverse
()
# guess portal_type to create lines
if
line_list
:
# guess portal_type to create lines
line_portal_type
=
line_list
[
0
].
getPortalType
()
for
line
in
line_list
:
for
line
in
line_list
:
new_line
=
reversal
.
newContent
(
portal_type
=
line_portal_type
)
new_line
.
edit
(
source
=
line
.
getSource
(
portal_type
=
'Account'
),
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_addToShoppingCart.py
View file @
b79c67cf
...
...
@@ -55,6 +55,7 @@ shopping_cart_items = context.SaleOrder_getShoppingCartItemList()
# get category like size and variation
category
=
request
.
form
.
get
(
'field_variation_box_your_category'
,
''
)
base_category
=
''
if
category
:
[
base_category
,
category
]
=
category
.
split
(
'/'
,
1
)
variation
=
request
.
form
.
get
(
'field_variation_box_your_variation'
,
None
)
...
...
bt5/erp5_advanced_ecommerce/SkinTemplateItem/portal_skins/erp5_advanced_ecommerce/Resource_getPriceCalculationDefaultContext.py
View file @
b79c67cf
...
...
@@ -37,8 +37,7 @@ else:
variation_dict
[
"start_date"
]
=
date
variation_dict
[
"stop_date"
]
=
date
+
0.00001
if
web_site_value
is
not
None
:
price_currency_value
=
web_site_value
.
WebSite_getShoppingCartDefaultCurrency
()
price_currency_value
=
web_site_value
.
WebSite_getShoppingCartDefaultCurrency
()
movement
=
context
.
newContent
(
temp_object
=
True
,
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.py
View file @
b79c67cf
...
...
@@ -28,6 +28,8 @@ elif aggregation_level == "week":
sql_format
=
"%Y-%u"
elif
aggregation_level
==
"day"
:
sql_format
=
"%Y-%m-%d"
else
:
raise
ValueError
(
"Unsupported aggregation level %s"
%
aggregation_level
)
if
to_date
is
not
None
:
to_date
=
atTheEndOfPeriod
(
to_date
,
period
=
aggregation_level
)
count_kw
=
{}
...
...
bt5/erp5_big_file/DocumentTemplateItem/portal_components/document.erp5.BigFile.py
View file @
b79c67cf
...
...
@@ -29,9 +29,10 @@ import io
import
six
if
six
.
PY3
:
long
=
int
# pylint:disable=redefined-builtin
long
_or_int
=
int
from
email.generator
import
_make_boundary
as
choose_boundary
else
:
long_or_int
=
long
from
mimetools
import
choose_boundary
# pylint:disable=import-error
class
BigFile
(
File
):
...
...
@@ -193,13 +194,13 @@ class BigFile(File):
else
:
# Date
date
=
if_range
.
split
(
';'
)[
0
]
try
:
mod_since
=
long
(
DateTime
(
date
).
timeTime
())
try
:
mod_since
=
long
_or_int
(
DateTime
(
date
).
timeTime
())
except
Exception
:
mod_since
=
None
if
mod_since
is
not
None
:
last_mod
=
self
.
_data_mtime
()
if
last_mod
is
None
:
last_mod
=
0
last_mod
=
long
(
last_mod
)
last_mod
=
long
_or_int
(
last_mod
)
if
last_mod
>
mod_since
:
# Modified, so send a normal response. We delete
# the ranges, which causes us to skip to the 200
...
...
bt5/erp5_configurator/DocumentTemplateItem/portal_components/document.erp5.CategoriesSpreadsheetConfiguratorItem.py
View file @
b79c67cf
...
...
@@ -76,6 +76,7 @@ class CategoriesSpreadsheetConfiguratorItem(ConfiguratorItemMixin, XMLObject):
# the bc should be added as base category in bt5 ?
error_list
.
append
(
self
.
_createConstraintMessage
(
"Base Category %s should be created"
%
bc_id
))
continue
if
fixit
:
bc
=
ctool
.
newContent
(
id
=
bc_id
)
...
...
bt5/erp5_configurator/ToolComponentTemplateItem/portal_components/tool.erp5.ConfiguratorTool.py
View file @
b79c67cf
...
...
@@ -228,6 +228,7 @@ class ConfiguratorTool(BaseTool):
return
response
## show next form in transitions
html
=
None
rendered
=
False
while
rendered
is
False
:
if
need_validation
==
1
:
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getFastInputLineList.py
View file @
b79c67cf
...
...
@@ -21,7 +21,7 @@ if line_portal_type in portal.getPortalSaleTypeList():
section_uid
=
context
.
getSourceSectionUid
()
elif
line_portal_type
in
portal
.
getPortalPurchaseTypeList
():
section_uid
=
context
.
getDestinationSectionUid
()
el
if
line_portal_type
in
portal
.
getPortalInternalTypeList
()
+
portal
.
getPortalInventoryMovementTypeList
()
:
el
se
:
section_uid
=
None
len_line_list
=
len
(
line_list
)
used_id
=
[]
# list use to make sure we do not generate two line with same id/uid
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_setFastInputLineList.py
View file @
b79c67cf
...
...
@@ -29,6 +29,7 @@ for line in listbox:
product
=
source_document
.
getResourceValue
()
else
:
source_document
=
None
product
=
None
# update original line/cell if given
if
source_document
is
not
None
:
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_updateFastInputLineList.py
View file @
b79c67cf
...
...
@@ -43,6 +43,7 @@ elif line_portal_type in portal.getPortalInternalTypeList():
elif
line_portal_type
in
portal
.
getPortalInventoryMovementTypeList
():
section_uid
=
None
no_inventory
=
True
supply_cell_portal_type
=
supply_line_id
=
None
use_list
=
portal
.
portal_preferences
.
getPreferredPurchaseUseList
()
\
+
portal
.
portal_preferences
.
getPreferredSaleUseList
()
else
:
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/OrderModule_activateGetOrderStatList.py
View file @
b79c67cf
...
...
@@ -51,6 +51,8 @@ elif aggregation_level == "week":
date_format
=
"%Y-%U"
elif
aggregation_level
==
"day"
:
date_format
=
"%Y-%m-%d"
else
:
raise
ValueError
(
"Unsupported aggregation_level: %s"
%
aggregation_level
)
if
from_date
is
not
None
and
at_date
is
not
None
:
catalog_params
[
'delivery.start_date'
]
=
{
...
...
bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/Base_convertHtmlToSingleFile.py
View file @
b79c67cf
...
...
@@ -253,6 +253,7 @@ if force_base_url:
root_url
=
"/"
.
join
(
base_url
.
split
(
"/"
,
3
)[:
3
])
if
root_url
!=
base_url
:
base_url
=
"/"
.
join
(
base_url
.
split
(
"/"
)[:
-
1
])
request_protocol
=
'https:'
else
:
request_protocol
=
context
.
REQUEST
.
SERVER_URL
.
split
(
":"
,
1
)[
0
]
+
":"
root_url
=
base_url_root_object
.
absolute_url
()
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisableItem.py
View file @
b79c67cf
...
...
@@ -986,7 +986,8 @@ class ImmobilisableItem(Item, Amount):
raw_annuity_price
=
annuity_start_price
*
current_ratio
elif
price_calculation_basis
==
"period recalculated start price"
:
raw_annuity_price
=
local_period_start_price
*
current_ratio
else
:
raise
ValueError
(
"Unsupported price_calculation_basis: %s"
%
price_calculation_basis
)
# Apply the prorata temporis on the raw annuity value
if
annuity_number
and
\
price_calculation_basis
==
'period recalculated start price'
and
\
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
View file @
b79c67cf
...
...
@@ -271,7 +271,7 @@ class AmountGeneratorMixin:
- is rounding really well supported (ie. before and after aggregation)
very likely not - proxying before or after must be decided
"""
# pylint:disable=self-cls-assignment
# pylint:disable=self-cls-assignment
,possibly-used-before-assignment
# It is the only place where we can import this
portal
=
self
.
getPortalObject
()
getRoundingProxy
=
portal
.
portal_roundings
.
getRoundingProxy
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.ExpandPolicy.py
View file @
b79c67cf
...
...
@@ -87,7 +87,7 @@ class _Policy(six.with_metaclass(_PolicyMetaClass, object)):
if
attr
==
'merge_parent'
:
self
.
merge_parent
=
value
=
self
.
context
.
getRootAppliedRule
().
getPath
()
else
:
object
.
__getattribute__
(
self
,
attr
)
value
=
object
.
__getattribute__
(
self
,
attr
)
return
value
def
deferAll
(
self
):
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_validateRelation.py
View file @
b79c67cf
...
...
@@ -8,6 +8,7 @@ request=context.REQUEST
# We stop doing this
#base_category = context.getBaseCategoryId()
base_category
=
None
redirect_url
=
None
o
=
context
.
restrictedTraverse
(
object_path
)
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_getModifiableFieldList.py
View file @
b79c67cf
...
...
@@ -42,7 +42,7 @@ skin_id_list = context.getTemplateSkinIdList()
if
skin_id_list
:
if
bt_title
in
skin_id_list
:
main_skin_id
=
bt_title
el
if
skin_id_list
:
el
se
:
main_skin_id
=
skin_id_list
[
0
]
form_path
=
'%s/%s'
%
(
main_skin_id
,
field_library_id
)
form
=
getForm
(
portal
.
portal_skins
[
main_skin_id
],
field_library_id
)
...
...
product/ERP5Type/patches/pylint_compatibility_disable.py
View file @
b79c67cf
...
...
@@ -8,56 +8,61 @@ class CompatibilityDisableChecker(checkers.BaseChecker):
name
=
"compatibility-disable"
msgs
=
{
"E999
0
"
:
(
"E999
9
"
:
(
"not-an-iterable"
,
"not-an-iterable"
,
""
,
),
"E999
1
"
:
(
"E999
8
"
:
(
"misplaced-bare-raise"
,
"misplaced-bare-raise"
,
""
,
),
"
W9992
"
:
(
"
E9997
"
:
(
"unused-private-member"
,
"unused-private-member"
,
""
,
),
"E999
3
"
:
(
"E999
6
"
:
(
"using-constant-test"
,
"using-constant-test"
,
""
),
"E999
4
"
:
(
"E999
5
"
:
(
"modified-iterating-list"
,
"modified-iterating-list"
,
""
,
),
"E999
5
"
:
(
"E999
4
"
:
(
"unsubscriptable-object"
,
"unsubscriptable-object"
,
""
,
),
"E999
6
"
:
(
"E999
3
"
:
(
"invalid-unary-operand-type"
,
"invalid-unary-operand-type"
,
""
,
),
"E999
7
"
:
(
"E999
2
"
:
(
"unbalanced-dict-unpacking"
,
"unbalanced-dict-unpacking"
,
""
,
),
"E999
8
"
:
(
"E999
1
"
:
(
"self-cls-assignment"
,
"self-cls-assignment"
,
""
,
),
"E999
9
"
:
(
"E999
0
"
:
(
"deprecated-class"
,
"deprecated-class"
,
""
,
),
"E9989"
:
(
"possibly-used-before-assignment"
,
"possibly-used-before-assignment"
,
""
)
}
...
...
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