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
Carlos Ramos Carreño
erp5
Commits
3bc593c9
Commit
3bc593c9
authored
Apr 24, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: pylint for py3
parent
7abcabfa
Changes
30
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
97 additions
and
108 deletions
+97
-108
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Amount.py
...entTemplateItem/portal_components/document.erp5.Amount.py
+2
-3
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.AppliedRule.py
...mplateItem/portal_components/document.erp5.AppliedRule.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ContributionPredicate.py
.../portal_components/document.erp5.ContributionPredicate.py
+12
-12
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Delivery.py
...tTemplateItem/portal_components/document.erp5.Delivery.py
+0
-2
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.EmailDocument.py
...lateItem/portal_components/document.erp5.EmailDocument.py
+0
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.File.py
...umentTemplateItem/portal_components/document.erp5.File.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationDelivery.py
...portal_components/document.erp5.ImmobilisationDelivery.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationMovement.py
...portal_components/document.erp5.ImmobilisationMovement.py
+2
-2
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Item.py
...umentTemplateItem/portal_components/document.erp5.Item.py
+0
-12
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Order.py
...mentTemplateItem/portal_components/document.erp5.Order.py
+35
-37
product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.ZODBHistory.py
...plateItem/portal_components/extension.erp5.ZODBHistory.py
+1
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
...Item/portal_components/mixin.erp5.AmountGeneratorMixin.py
+1
-0
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CompositionMixin.py
...lateItem/portal_components/mixin.erp5.CompositionMixin.py
+2
-2
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DocumentExtensibleTraversableMixin.py
...mponents/mixin.erp5.DocumentExtensibleTraversableMixin.py
+1
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin.py
...ateItem/portal_components/mixin.erp5.DownloadableMixin.py
+1
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.RuleMixin.py
...xinTemplateItem/portal_components/mixin.erp5.RuleMixin.py
+2
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.VirtualFolderMixin.py
...teItem/portal_components/mixin.erp5.VirtualFolderMixin.py
+1
-1
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.Log.py
...omponentTemplateItem/portal_components/module.erp5.Log.py
+0
-1
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.MovementGroup.py
...mplateItem/portal_components/module.erp5.MovementGroup.py
+2
-1
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.WebDAVSupport.py
...mplateItem/portal_components/module.erp5.WebDAVSupport.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.py
...l_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.py
+2
-2
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_parseSearchString.py
...lateItem/portal_skins/erp5_core/Base_parseSearchString.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_workflowStatusModify.py
...eItem/portal_skins/erp5_core/Base_workflowStatusModify.py
+12
-13
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_getPreferredPredicateCategoryParentUidItemList.py
...oryTool_getPreferredPredicateCategoryParentUidItemList.py
+5
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py
...portal_skins/erp5_core/CategoryTool_importCategoryFile.py
+5
-2
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkNamingConventions.py
...portal_skins/erp5_core/ERP5Site_checkNamingConventions.py
+1
-1
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.ContributionTool.py
...plateItem/portal_components/tool.erp5.ContributionTool.py
+1
-2
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.DiffTool.py
...onentTemplateItem/portal_components/tool.erp5.DiffTool.py
+2
-2
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.IntrospectionTool.py
...lateItem/portal_components/tool.erp5.IntrospectionTool.py
+1
-1
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
...emplateItem/portal_components/tool.erp5.SimulationTool.py
+1
-1
No files found.
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Amount.py
View file @
3bc593c9
...
@@ -195,7 +195,6 @@ class Amount(Base, VariatedMixin):
...
@@ -195,7 +195,6 @@ class Amount(Base, VariatedMixin):
"""Do nothing in the case of an amount, because variation base category
"""Do nothing in the case of an amount, because variation base category
list are set on the resource.
list are set on the resource.
"""
"""
pass
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getVariationBaseCategoryItemList'
)
'getVariationBaseCategoryItemList'
)
...
@@ -577,7 +576,7 @@ class Amount(Base, VariatedMixin):
...
@@ -577,7 +576,7 @@ class Amount(Base, VariatedMixin):
if
destination
in
(
None
,
''
):
if
destination
in
(
None
,
''
):
if
quantity
<
0
:
if
quantity
<
0
:
return
-
quantity
return
-
quantity
# pylint:disable=invalid-unary-operand-type
else
:
else
:
return
0.0
return
0.0
...
@@ -604,7 +603,7 @@ class Amount(Base, VariatedMixin):
...
@@ -604,7 +603,7 @@ class Amount(Base, VariatedMixin):
if
source
in
(
None
,
''
):
if
source
in
(
None
,
''
):
if
quantity
<
0
:
if
quantity
<
0
:
return
-
quantity
return
-
quantity
# pylint:disable=invalid-unary-operand-type
else
:
else
:
return
0.0
return
0.0
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.AppliedRule.py
View file @
3bc593c9
...
@@ -317,7 +317,7 @@ class AppliedRule(XMLObject, ExplainableMixin):
...
@@ -317,7 +317,7 @@ class AppliedRule(XMLObject, ExplainableMixin):
try
:
try
:
best_sm_list
=
best_dict
[
None
]
best_sm_list
=
best_dict
[
None
]
except
KeyError
:
except
KeyError
:
best_sm_list
,
=
best_dict
.
values
()
best_sm_list
,
=
best_dict
.
values
()
# pylint:disable=unbalanced-dict-unpacking
if
len
(
best_sm_list
)
<
len
(
sm_list
):
if
len
(
best_sm_list
)
<
len
(
sm_list
):
sm_dict
[
k
]
=
list
(
set
(
sm_list
).
difference
(
best_sm_list
))
sm_dict
[
k
]
=
list
(
set
(
sm_list
).
difference
(
best_sm_list
))
sm_list
=
best_sm_list
sm_list
=
best_sm_list
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ContributionPredicate.py
View file @
3bc593c9
...
@@ -69,26 +69,26 @@ class ContributionPredicate(Predicate, XMLObject):
...
@@ -69,26 +69,26 @@ class ContributionPredicate(Predicate, XMLObject):
This method returns portal type name if test success, else returns False.
This method returns portal type name if test success, else returns False.
"""
"""
self
=
self
.
asPredicate
()
self
_as_predicate
=
self
.
asPredicate
()
result
=
1
result
=
1
if
getattr
(
aq_base
(
self
),
'_identity_criterion'
,
None
)
is
None
:
if
getattr
(
aq_base
(
self
_as_predicate
),
'_identity_criterion'
,
None
)
is
None
:
self
.
_identity_criterion
=
{}
self
_as_predicate
.
_identity_criterion
=
{}
self
.
_range_criterion
=
{}
self
_as_predicate
.
_range_criterion
=
{}
for
property_
,
value
in
six
.
iteritems
(
self
.
_identity_criterion
):
for
property_
,
value
in
six
.
iteritems
(
self
_as_predicate
.
_identity_criterion
):
result
=
result
and
(
context
.
getProperty
(
property_
)
in
value
)
result
=
result
and
(
context
.
getProperty
(
property_
)
in
value
)
for
property_
,
(
min_
,
max_
)
in
six
.
iteritems
(
self
.
_range_criterion
):
for
property_
,
(
min_
,
max_
)
in
six
.
iteritems
(
self
_as_predicate
.
_range_criterion
):
value
=
context
.
getProperty
(
property_
)
value
=
context
.
getProperty
(
property_
)
if
min_
is
not
None
:
if
min_
is
not
None
:
result
=
result
and
(
value
>=
min_
)
result
=
result
and
(
value
>=
min_
)
if
max_
is
not
None
:
if
max_
is
not
None
:
result
=
result
and
(
value
<
max_
)
result
=
result
and
(
value
<
max_
)
multimembership_criterion_base_category_list
=
\
multimembership_criterion_base_category_list
=
\
self
.
getMultimembershipCriterionBaseCategoryList
()
self
_as_predicate
.
getMultimembershipCriterionBaseCategoryList
()
membership_criterion_base_category_list
=
\
membership_criterion_base_category_list
=
\
self
.
getMembershipCriterionBaseCategoryList
()
self
_as_predicate
.
getMembershipCriterionBaseCategoryList
()
tested_base_category
=
{}
tested_base_category
=
{}
membership_criterion_category_list
=
\
membership_criterion_category_list
=
\
self
.
getMembershipCriterionCategoryList
()
self
_as_predicate
.
getMembershipCriterionCategoryList
()
if
tested_base_category_list
is
not
None
:
if
tested_base_category_list
is
not
None
:
membership_criterion_category_list
=
[
x
for
x
in
\
membership_criterion_category_list
=
[
x
for
x
in
\
membership_criterion_category_list
if
x
.
split
(
'/'
,
1
)[
0
]
in
\
membership_criterion_category_list
if
x
.
split
(
'/'
,
1
)[
0
]
in
\
...
@@ -115,14 +115,14 @@ class ContributionPredicate(Predicate, XMLObject):
...
@@ -115,14 +115,14 @@ class ContributionPredicate(Predicate, XMLObject):
result
=
result
and
(
0
not
in
tested_base_category
.
values
())
result
=
result
and
(
0
not
in
tested_base_category
.
values
())
# Test method calls
# Test method calls
test_method_id_list
=
self
.
getTestMethodIdList
()
test_method_id_list
=
self
_as_predicate
.
getTestMethodIdList
()
if
test_method_id_list
:
if
test_method_id_list
:
for
test_method_id
in
test_method_id_list
:
for
test_method_id
in
test_method_id_list
:
if
(
test_method_id
is
not
None
)
and
result
:
if
(
test_method_id
is
not
None
)
and
result
:
method
=
getattr
(
context
,
test_method_id
)
method
=
getattr
(
context
,
test_method_id
)
result
=
result
and
method
(
self
)
result
=
result
and
method
(
self
_as_predicate
)
else
:
else
:
result
=
result
and
self
.
getDestinationPortalType
()
result
=
result
and
self
_as_predicate
.
getDestinationPortalType
()
return
result
return
result
def
asQuery
(
self
,
*
args
,
**
kw
):
def
asQuery
(
self
,
*
args
,
**
kw
):
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Delivery.py
View file @
3bc593c9
...
@@ -741,7 +741,6 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
...
@@ -741,7 +741,6 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
"""
"""
This is a hack
This is a hack
"""
"""
pass
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getParentExplanationValue'
)
'getParentExplanationValue'
)
...
@@ -761,7 +760,6 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
...
@@ -761,7 +760,6 @@ class Delivery(XMLObject, ImmobilisationDelivery, SimulableMixin,
"""
"""
This is a hack
This is a hack
"""
"""
pass
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getBuilderList'
)
'getBuilderList'
)
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.EmailDocument.py
View file @
3bc593c9
...
@@ -309,7 +309,6 @@ class EmailDocument(TextDocument, MailMessageMixin):
...
@@ -309,7 +309,6 @@ class EmailDocument(TextDocument, MailMessageMixin):
to extract content information from this mail
to extract content information from this mail
message.
message.
"""
"""
pass
security.declareProtected(Permissions.View, '
index_html
')
security.declareProtected(Permissions.View, '
index_html
')
index_html = TextDocument.index_html
index_html = TextDocument.index_html
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.File.py
View file @
3bc593c9
...
@@ -153,7 +153,7 @@ class File(Document, OFS_File):
...
@@ -153,7 +153,7 @@ class File(Document, OFS_File):
security
.
declarePrivate
(
'update_data'
)
security
.
declarePrivate
(
'update_data'
)
def
update_data
(
self
,
*
args
,
**
kw
):
def
update_data
(
self
,
*
args
,
**
kw
):
super
(
File
,
self
).
update_data
(
*
args
,
**
kw
)
super
(
File
,
self
).
update_data
(
*
args
,
**
kw
)
if
six
.
PY2
and
isinstance
(
self
.
size
,
long
):
# pylint:disable=undefined-variable
if
six
.
PY2
and
isinstance
(
self
.
size
,
long
):
# pylint:disable=
access-member-before-definition,
undefined-variable
self
.
size
=
int
(
self
.
size
)
self
.
size
=
int
(
self
.
size
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setFile'
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setFile'
)
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationDelivery.py
View file @
3bc593c9
...
@@ -119,7 +119,7 @@ class ImmobilisationDelivery(XMLObject):
...
@@ -119,7 +119,7 @@ class ImmobilisationDelivery(XMLObject):
sub_movement_list
=
self
.
contentValues
()
sub_movement_list
=
self
.
contentValues
()
for
movement
in
self
.
getImmobilisationMovementList
(
**
kw
):
for
movement
in
self
.
getImmobilisationMovementList
(
**
kw
):
for
item
in
movement
.
getAggregateValueList
():
for
item
in
movement
.
getAggregateValueList
():
if
IImmobilisationItem
.
providedBy
(
item
):
if
IImmobilisationItem
.
providedBy
(
item
):
# pylint:disable=no-value-for-parameter
future_movement_list
=
item
.
getFutureImmobilisationMovementValueList
(
future_movement_list
=
item
.
getFutureImmobilisationMovementValueList
(
at_date
=
self
.
getStopDate
(),
at_date
=
self
.
getStopDate
(),
from_movement
=
self
,
from_movement
=
self
,
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationMovement.py
View file @
3bc593c9
...
@@ -142,7 +142,7 @@ class ImmobilisationMovement(Movement, XMLObject):
...
@@ -142,7 +142,7 @@ class ImmobilisationMovement(Movement, XMLObject):
# Check if the date of this movement is unique
# Check if the date of this movement is unique
date_error
=
0
date_error
=
0
for
item
in
self
.
getAggregateValueList
():
for
item
in
self
.
getAggregateValueList
():
if
IImmobilisationItem
.
providedBy
(
item
):
if
IImmobilisationItem
.
providedBy
(
item
):
# pylint:disable=no-value-for-parameter
same_date_list
=
item
.
getUnfilteredImmobilisationMovementValueList
(
same_date_list
=
item
.
getUnfilteredImmobilisationMovementValueList
(
from_date
=
self
.
getStopDate
(),
from_date
=
self
.
getStopDate
(),
to_date
=
self
.
getStopDate
(),
to_date
=
self
.
getStopDate
(),
...
@@ -200,7 +200,7 @@ class ImmobilisationMovement(Movement, XMLObject):
...
@@ -200,7 +200,7 @@ class ImmobilisationMovement(Movement, XMLObject):
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
return
checkPreviousMovementForItem
(
previous_movement
,
item
)
for
item
in
self
.
getAggregateValueList
():
for
item
in
self
.
getAggregateValueList
():
if
IImmobilisationItem
.
providedBy
(
item
):
if
IImmobilisationItem
.
providedBy
(
item
):
# pylint:disable=no-value-for-parameter
if
not
checkPreviousMovementForItem
(
self
,
item
):
if
not
checkPreviousMovementForItem
(
self
,
item
):
check_uncontinuous
=
1
check_uncontinuous
=
1
else
:
else
:
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Item.py
View file @
3bc593c9
...
@@ -58,18 +58,6 @@ class Item(XMLObject, Amount):
...
@@ -58,18 +58,6 @@ class Item(XMLObject, Amount):
,
PropertySheet
.
Reference
,
PropertySheet
.
Reference
)
)
if
0
:
# The following code is disabled. The original intention was to generate
# an unique reference for each item. We now use reference instead of id,
# so this is not applicable any longer. We need something different for
# reference.
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'generateNewId'
)
def
generateNewId
(
self
,
id_group
=
'item_id_group'
,
default
=
None
,
method
=
None
):
"""
We want a different id for all Item
"""
return
XMLObject
.
generateNewId
(
self
,
id_group
=
id_group
,
default
=
default
,
method
=
method
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getPrice'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getPrice'
)
def
getPrice
(
self
,
context
=
None
,
**
kw
):
def
getPrice
(
self
,
context
=
None
,
**
kw
):
"""
"""
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Order.py
View file @
3bc593c9
...
@@ -80,43 +80,41 @@ class Order(Delivery):
...
@@ -80,43 +80,41 @@ class Order(Delivery):
# Call getAggregatedAmountList and sum all the amounts which
# Call getAggregatedAmountList and sum all the amounts which
# base_contribution category is matched with.
# base_contribution category is matched with.
raise
NotImplementedError
raise
NotImplementedError
"""
# rounding = kw.get('rounding')
rounding = kw.get('rounding')
# from Products.ERP5.PropertySheet.TradeModelLine import TARGET_LEVEL_MOVEMENT
from Products.ERP5.PropertySheet.TradeModelLine import TARGET_LEVEL_MOVEMENT
# trade_condition = self.getSpecialiseValue()
trade_condition = self.getSpecialiseValue()
# if trade_condition is None:
if trade_condition is None:
# # We cannot find any amount so that the result is 0.
# We cannot find any amount so that the result is 0.
# return 0
return 0
# base_contribution = kw.get('base_contribution')
base_contribution = kw.get('base_contribution')
# if isinstance(base_contribution, (tuple, list)):
if isinstance(base_contribution, (tuple, list)):
# base_contribution_list = base_contribution
base_contribution_list = base_contribution
# else:
else:
# base_contribution_list = (base_contribution,)
base_contribution_list = (base_contribution,)
# base_contribution_value_list = []
base_contribution_value_list = []
# portal_categories = self.portal_categories
portal_categories = self.portal_categories
# for relative_url in base_contribution_list:
for relative_url in base_contribution_list:
# base_contribution_value = portal_categories.getCategoryValue(relative_url)
base_contribution_value = portal_categories.getCategoryValue(relative_url)
# if base_contribution_value is not None:
if base_contribution_value is not None:
# base_contribution_value_list.append(base_contribution_value)
base_contribution_value_list.append(base_contribution_value)
# if not base_contribution_value_list:
if not base_contribution_value_list:
# # We cannot find any amount so that the result is 0.
# We cannot find any amount so that the result is 0.
# return 0
return 0
# current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding, force_create_line=True)
current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding, force_create_line=True)
# trade_model_line = self.newContent(temp_object=True,
trade_model_line = self.newContent(temp_object=True,
# portal_type='Trade Model Line',
portal_type='Trade Model Line',
# id='_temp_' + self.getId(), notify_workflow=False)
id='_temp_' + self.getId(), notify_workflow=False)
# # prevent invoking interaction workflows.
# prevent invoking interaction workflows.
# trade_model_line.portal_type = ''
trade_model_line.portal_type = ''
# trade_model_line.edit(target_level=TARGET_LEVEL_MOVEMENT, price=1,
trade_model_line.edit(target_level=TARGET_LEVEL_MOVEMENT, price=1,
# efficiency=1, quantity=None,
efficiency=1, quantity=None,
# base_application_value_list=base_contribution_value_list)
base_application_value_list=base_contribution_value_list)
# aggregated_amount_list = trade_model_line._getAggregatedAmountList(
aggregated_amount_list = trade_model_line._getAggregatedAmountList(
# self,
self,
# movement_list=self.getMovementList(),
movement_list=self.getMovementList(),
# current_aggregated_amount_list=current_aggregated_amount_list,
current_aggregated_amount_list=current_aggregated_amount_list,
# rounding=rounding)
rounding=rounding)
# return aggregated_amount_list.getTotalPrice()
return aggregated_amount_list.getTotalPrice()
"""
def
getTotalQuantity
(
self
,
**
kw
)
:
def
getTotalQuantity
(
self
,
**
kw
)
:
"""Returns the total quantity for this Order. """
"""Returns the total quantity for this Order. """
...
...
product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.ZODBHistory.py
View file @
3bc593c9
...
@@ -41,7 +41,7 @@ def toDateTime(time):
...
@@ -41,7 +41,7 @@ def toDateTime(time):
elif
hasattr
(
time
,
'timeTime'
):
elif
hasattr
(
time
,
'timeTime'
):
# assume that the time is persistent.TimeStamp
# assume that the time is persistent.TimeStamp
return
DateTime
(
time
.
timeTime
())
return
DateTime
(
time
.
timeTime
())
raise
ValueError
(
'do not know the time type :%r'
,
time
)
raise
ValueError
(
'do not know the time type :%r'
%
time
)
def
_getWorkflowHistory
(
document
,
initial_datetime
):
def
_getWorkflowHistory
(
document
,
initial_datetime
):
history
=
[]
history
=
[]
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.AmountGeneratorMixin.py
View file @
3bc593c9
...
@@ -271,6 +271,7 @@ class AmountGeneratorMixin:
...
@@ -271,6 +271,7 @@ class AmountGeneratorMixin:
- is rounding really well supported (ie. before and after aggregation)
- is rounding really well supported (ie. before and after aggregation)
very likely not - proxying before or after must be decided
very likely not - proxying before or after must be decided
"""
"""
# pylint:disable=self-cls-assignment
# It is the only place where we can import this
# It is the only place where we can import this
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
getRoundingProxy
=
portal
.
portal_roundings
.
getRoundingProxy
getRoundingProxy
=
portal
.
portal_roundings
.
getRoundingProxy
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CompositionMixin.py
View file @
3bc593c9
...
@@ -193,7 +193,7 @@ class CompositionMixin:
...
@@ -193,7 +193,7 @@ class CompositionMixin:
'asComposedDocument'
)
'asComposedDocument'
)
asComposedDocument
=
transactional_cached
(
asComposedDocument
=
transactional_cached
(
lambda
self
,
portal_type_list
=
None
:
(
self
,
portal_type_list
)
lambda
self
,
portal_type_list
=
None
:
(
self
,
portal_type_list
)
)(
asComposedDocument
)
)(
asComposedDocument
)
# pylint:disable=used-before-assignment
# XXX add accessors to get properties from '_effective_model_list' ?
# XXX add accessors to get properties from '_effective_model_list' ?
# (cf PaySheetModel)
# (cf PaySheetModel)
...
@@ -226,7 +226,7 @@ class CompositionMixin:
...
@@ -226,7 +226,7 @@ class CompositionMixin:
model
=
_getEffectiveModel
(
model
,
start_date
,
stop_date
)
model
=
_getEffectiveModel
(
model
,
start_date
,
stop_date
)
if
model
not
in
effective_set
:
if
model
not
in
effective_set
:
effective_set
.
add
(
model
)
effective_set
.
add
(
model
)
if
1
:
#model.test(self): # XXX
if
1
:
#model.test(self): # XXX
# pylint:disable=using-constant-test
effective_list
.
append
(
model
)
effective_list
.
append
(
model
)
return
effective_list
,
specialise_value_list
return
effective_list
,
specialise_value_list
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DocumentExtensibleTraversableMixin.py
View file @
3bc593c9
...
@@ -57,7 +57,7 @@ class DocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
...
@@ -57,7 +57,7 @@ class DocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
# in some cases user (like Anonymous) can not view document according to portal catalog
# in some cases user (like Anonymous) can not view document according to portal catalog
# but we may ask him to login if such a document exists
# but we may ask him to login if such a document exists
isAuthorizationForced
=
getattr
(
self
,
'isAuthorizationForced'
,
None
)
isAuthorizationForced
=
getattr
(
self
,
'isAuthorizationForced'
,
None
)
if
isAuthorizationForced
is
not
None
and
isAuthorizationForced
():
if
isAuthorizationForced
is
not
None
and
isAuthorizationForced
():
# pylint:disable=not-callable
if
unrestricted_apply
(
self
.
getDocumentValue
,
(
name
,
portal
))
is
not
None
:
if
unrestricted_apply
(
self
.
getDocumentValue
,
(
name
,
portal
))
is
not
None
:
# force user to login as specified in Web Section
# force user to login as specified in Web Section
raise
Unauthorized
raise
Unauthorized
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin.py
View file @
3bc593c9
...
@@ -43,7 +43,7 @@ try:
...
@@ -43,7 +43,7 @@ try:
except
ImportError
:
except
ImportError
:
# BBB backport https://github.com/zopefoundation/Zope/pull/893 with py2 support
# BBB backport https://github.com/zopefoundation/Zope/pull/893 with py2 support
def
make_content_disposition
(
disposition
,
file_name
):
def
make_content_disposition
(
disposition
,
file_name
):
if
six
.
PY2
and
not
isinstance
(
file_name
,
unicod
e
):
if
six
.
PY2
and
not
isinstance
(
file_name
,
six
.
text_typ
e
):
file_name
=
file_name
.
decode
(
'utf-8'
)
file_name
=
file_name
.
decode
(
'utf-8'
)
try
:
try
:
file_name
.
encode
(
'us-ascii'
)
file_name
.
encode
(
'us-ascii'
)
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.RuleMixin.py
View file @
3bc593c9
...
@@ -79,7 +79,8 @@ class RuleMixin(Predicate):
...
@@ -79,7 +79,8 @@ class RuleMixin(Predicate):
return
context
.
newContent
(
portal_type
=
'Applied Rule'
,
return
context
.
newContent
(
portal_type
=
'Applied Rule'
,
specialise_value
=
self
,
**
kw
)
specialise_value
=
self
,
**
kw
)
if
0
:
# XXX-JPS - if people are stupid enough not to configfure predicates,
if
0
:
# pylint:disable=using-constant-test
# XXX-JPS - if people are stupid enough not to configfure predicates,
# it is not our role to be clever for them
# it is not our role to be clever for them
# Rules have a workflow - make sure applicable rule system works
# Rules have a workflow - make sure applicable rule system works
# if you wish, add a test here on workflow state to prevent using
# if you wish, add a test here on workflow state to prevent using
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.VirtualFolderMixin.py
View file @
3bc593c9
...
@@ -57,7 +57,7 @@ class VirtualFolderMixin:
...
@@ -57,7 +57,7 @@ class VirtualFolderMixin:
if
method
is
not
None
:
if
method
is
not
None
:
return
method
(
name
,
typ
,
body
)
return
method
(
name
,
typ
,
body
)
return
Folder
.
PUT_factory
(
self
,
name
,
typ
,
body
)
return
Folder
.
PUT_factory
(
self
,
name
,
typ
,
body
)
# pylint:disable=not-callable
security
.
declarePrivate
(
'_setObject'
)
security
.
declarePrivate
(
'_setObject'
)
def
_setObject
(
self
,
id
,
ob
,
**
kw
):
# pylint: disable=redefined-builtin
def
_setObject
(
self
,
id
,
ob
,
**
kw
):
# pylint: disable=redefined-builtin
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.Log.py
View file @
3bc593c9
...
@@ -33,7 +33,6 @@ from zLOG import (
...
@@ -33,7 +33,6 @@ from zLOG import (
TRACE
,
TRACE
,
DEBUG
,
DEBUG
,
BLATHER
,
BLATHER
,
INFO
,
PROBLEM
,
PROBLEM
,
WARNING
,
WARNING
,
ERROR
,
ERROR
,
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.MovementGroup.py
View file @
3bc593c9
...
@@ -160,7 +160,8 @@ class MovementGroupNode:
...
@@ -160,7 +160,8 @@ class MovementGroupNode:
movement
,
self
.
_property_dict
,
property_list
=
property_list
)
movement
,
self
.
_property_dict
,
property_list
=
property_list
)
# The following check is partial because it does not check mutable values
# The following check is partial because it does not check mutable values
# recursively.
# recursively.
if
property_dict
is
self
.
_property_dict
!=
property_dict
:
different_property_dict
=
self
.
_property_dict
!=
property_dict
if
property_dict
is
different_property_dict
:
raise
ValueError
(
raise
ValueError
(
"Movement Group must not modify the passed 'property_dict':"
"Movement Group must not modify the passed 'property_dict':"
" copy it, deeply if necessary, before editing properties"
)
" copy it, deeply if necessary, before editing properties"
)
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.WebDAVSupport.py
View file @
3bc593c9
...
@@ -47,7 +47,7 @@ class TextContent:
...
@@ -47,7 +47,7 @@ class TextContent:
try
:
try
:
tree
=
html
.
fromstring
(
text
)
tree
=
html
.
fromstring
(
text
)
if
tree
.
tag
!=
"html"
:
if
tree
.
tag
!=
"html"
:
raise
Exception
raise
ValueError
except
Exception
:
except
Exception
:
# this is probably not html code, try rfc822 parsing
# this is probably not html code, try rfc822 parsing
if
six
.
PY3
:
if
six
.
PY3
:
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getCategoriesSpreadSheetMapping.py
View file @
3bc593c9
...
@@ -104,9 +104,9 @@ for table_name in spreadsheet_list.keys():
...
@@ -104,9 +104,9 @@ for table_name in spreadsheet_list.keys():
# 1 table = 1 base category
# 1 table = 1 base category
base_category_name
=
table_name
base_category_name
=
table_name
base_category_id
=
getIDFromString
(
base_category_name
)
base_category_id
=
getIDFromString
(
base_category_name
)
if
six
.
PY2
and
isinstance
(
base_category_name
,
unicod
e
):
if
six
.
PY2
and
isinstance
(
base_category_name
,
six
.
text_typ
e
):
base_category_name
=
base_category_name
.
encode
(
'utf8'
)
base_category_name
=
base_category_name
.
encode
(
'utf8'
)
if
six
.
PY2
and
isinstance
(
base_category_id
,
unicod
e
):
if
six
.
PY2
and
isinstance
(
base_category_id
,
six
.
text_typ
e
):
base_category_id
=
base_category_id
.
encode
(
'utf8'
)
base_category_id
=
base_category_id
.
encode
(
'utf8'
)
category_list
=
category_list_spreadsheet_mapping
.
setdefault
(
base_category_id
,
[])
category_list
=
category_list_spreadsheet_mapping
.
setdefault
(
base_category_id
,
[])
category_list
.
append
({
'path'
:
base_category_id
category_list
.
append
({
'path'
:
base_category_id
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_parseSearchString.py
View file @
3bc593c9
...
@@ -101,7 +101,7 @@ def resolveCriterion(criterion_alias, criterion_value_list):
...
@@ -101,7 +101,7 @@ def resolveCriterion(criterion_alias, criterion_value_list):
break
break
seen_alias_dict
[
criterion_alias
]
=
None
seen_alias_dict
[
criterion_alias
]
=
None
if
next_alias
in
seen_alias_dict
:
if
next_alias
in
seen_alias_dict
:
raise
Exception
(
'Endless alias loop detected: lookup of %r reached alias %r twice'
%
(
initial_criterion_alias
,
next_alias
))
raise
RuntimeError
(
'Endless alias loop detected: lookup of %r reached alias %r twice'
%
(
initial_criterion_alias
,
next_alias
))
criterion_alias
=
next_alias
criterion_alias
=
next_alias
return
criterion_alias
,
criterion_value_list
return
criterion_alias
,
criterion_value_list
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_workflowStatusModify.py
View file @
3bc593c9
...
@@ -3,15 +3,14 @@ from Products.CMFCore.WorkflowCore import WorkflowException
...
@@ -3,15 +3,14 @@ from Products.CMFCore.WorkflowCore import WorkflowException
o
=
context
.
getObject
()
o
=
context
.
getObject
()
if
1
:
# keep indentation
try
:
try
:
context
.
portal_workflow
.
doActionFor
(
o
,
context
.
portal_workflow
.
doActionFor
(
o
,
workflow_action
,
workflow_action
,
comment
=
comment
,
comment
=
comment
,
**
kw
)
**
kw
)
except
WorkflowException
:
except
WorkflowException
:
pass
pass
except
ValidationFailed
as
message
:
except
ValidationFailed
as
message
:
if
getattr
(
message
,
'msg'
,
None
)
and
same_type
(
message
.
msg
,
[]):
if
getattr
(
message
,
'msg'
,
None
)
and
same_type
(
message
.
msg
,
[]):
message
=
'. '
.
join
(
'%s'
%
x
for
x
in
message
.
msg
)
message
=
'. '
.
join
(
'%s'
%
x
for
x
in
message
.
msg
)
if
not
batch
:
if
not
batch
:
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_getPreferredPredicateCategoryParentUidItemList.py
View file @
3bc593c9
...
@@ -29,5 +29,9 @@ for base_category_id in preferred_predicate_category_list:
...
@@ -29,5 +29,9 @@ for base_category_id in preferred_predicate_category_list:
uid_item_list_list
=
category_parent_uid_item_dict
.
values
()
uid_item_list_list
=
category_parent_uid_item_dict
.
values
()
if
uid_item_list_list
:
if
uid_item_list_list
:
return
reduce
(
lambda
a
,
b
:
a
+
b
,
uid_item_list_list
)
result
=
[]
for
uid_item_list
in
uid_item_list_list
:
result
.
extend
(
uid_item_list
)
return
result
return
()
return
()
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/CategoryTool_importCategoryFile.py
View file @
3bc593c9
...
@@ -60,7 +60,7 @@ if detailed_report_result:
...
@@ -60,7 +60,7 @@ if detailed_report_result:
REQUEST
.
other
[
'category_import_report'
]
=
detailed_report_result
REQUEST
.
other
[
'category_import_report'
]
=
detailed_report_result
REQUEST
.
RESPONSE
.
setBody
(
portal_categories
.
CategoryTool_viewImportReport
().
encode
(
'utf-8'
),
lock
=
True
)
REQUEST
.
RESPONSE
.
setBody
(
portal_categories
.
CategoryTool_viewImportReport
().
encode
(
'utf-8'
),
lock
=
True
)
REQUEST
.
RESPONSE
.
setStatus
(
200
,
'OK'
,
lock
=
True
)
REQUEST
.
RESPONSE
.
setStatus
(
200
,
'OK'
,
lock
=
True
)
raise
Exception
(
'Spreadsheet contains errors'
)
raise
ValueError
(
'Spreadsheet contains errors'
)
for
base_category
,
category_list
in
six
.
iteritems
(
category_list_spreadsheet_dict
):
for
base_category
,
category_list
in
six
.
iteritems
(
category_list_spreadsheet_dict
):
total_category_counter
+=
len
(
category_list
)
total_category_counter
+=
len
(
category_list
)
...
@@ -212,7 +212,10 @@ if detailed_report:
...
@@ -212,7 +212,10 @@ if detailed_report:
if
simulation_mode
:
if
simulation_mode
:
REQUEST
.
RESPONSE
.
setBody
(
result
,
lock
=
True
)
REQUEST
.
RESPONSE
.
setBody
(
result
,
lock
=
True
)
REQUEST
.
RESPONSE
.
setStatus
(
200
,
'OK'
,
lock
=
True
)
REQUEST
.
RESPONSE
.
setStatus
(
200
,
'OK'
,
lock
=
True
)
raise
Exception
(
'Dry run'
)
class
DryRun
(
Exception
):
"""Exception raised to not commit transaction.
"""
raise
DryRun
()
return
result
return
result
portal_categories
.
Base_redirect
(
portal_categories
.
Base_redirect
(
keep_items
=
{
keep_items
=
{
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_checkNamingConventions.py
View file @
3bc593c9
...
@@ -97,7 +97,7 @@ def checkField(folder, form, field):
...
@@ -97,7 +97,7 @@ def checkField(folder, form, field):
if
a
not
in
(
None
,
"portal_catalog"
,
"searchFolder"
,
"objectValues"
,
if
a
not
in
(
None
,
"portal_catalog"
,
"searchFolder"
,
"objectValues"
,
"contentValues"
,
"ListBox_initializeFastInput"
):
"contentValues"
,
"ListBox_initializeFastInput"
):
if
not
a
.
endswith
(
'List'
):
if
not
a
.
endswith
(
'List'
):
if
0
:
if
0
:
# pylint:disable=using-constant-test
error_message
+=
"%s : %s : %r Bad Naming Convention
\
n
"
%
(
path
,
id_
,
a
)
error_message
+=
"%s : %s : %r Bad Naming Convention
\
n
"
%
(
path
,
id_
,
a
)
return
error_message
return
error_message
...
...
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.ContributionTool.py
View file @
3bc593c9
...
@@ -90,7 +90,7 @@ class ContributionTool(BaseTool):
...
@@ -90,7 +90,7 @@ class ContributionTool(BaseTool):
security
.
declareProtected
(
Permissions
.
AddPortalContent
,
'newContent'
)
security
.
declareProtected
(
Permissions
.
AddPortalContent
,
'newContent'
)
@
fill_args_from_request
(
'data'
,
'filename'
,
'portal_type'
,
'container_path'
,
@
fill_args_from_request
(
'data'
,
'filename'
,
'portal_type'
,
'container_path'
,
'discover_metadata'
,
'temp_object'
,
'reference'
)
'discover_metadata'
,
'temp_object'
,
'reference'
)
def
newContent
(
self
,
REQUEST
=
None
,
**
kw
):
def
newContent
(
self
,
REQUEST
=
None
,
**
kw
):
# pylint:disable=arguments-differ
"""
"""
The newContent method is overriden to implement smart content
The newContent method is overriden to implement smart content
creation by detecting the portal type based on whatever information
creation by detecting the portal type based on whatever information
...
@@ -283,7 +283,6 @@ class ContributionTool(BaseTool):
...
@@ -283,7 +283,6 @@ class ContributionTool(BaseTool):
Create a new content based on XML data. This is intended for contributing
Create a new content based on XML data. This is intended for contributing
to ERP5 from another application.
to ERP5 from another application.
"""
"""
pass
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'getMatchedFilenamePatternDict'
)
'getMatchedFilenamePatternDict'
)
...
...
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.DiffTool.py
View file @
3bc593c9
...
@@ -28,12 +28,12 @@
...
@@ -28,12 +28,12 @@
##############################################################################
##############################################################################
import
six
import
six
# pylint:disable=no-name-in-module,import-error
# pylint:disable=no-name-in-module,import-error
,deprecated-class
if
six
.
PY3
:
if
six
.
PY3
:
from
collections.abc
import
Set
from
collections.abc
import
Set
else
:
else
:
from
collections
import
Set
from
collections
import
Set
# pylint:enable=no-name-in-module,import-error
# pylint:enable=no-name-in-module,import-error
,deprecated-class
import
difflib
import
difflib
import
warnings
import
warnings
...
...
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.IntrospectionTool.py
View file @
3bc593c9
...
@@ -349,7 +349,7 @@ class IntrospectionTool(LogMixin, BaseTool):
...
@@ -349,7 +349,7 @@ class IntrospectionTool(LogMixin, BaseTool):
def
cached_getSystemVersionDict
():
def
cached_getSystemVersionDict
():
import
pkg_resources
import
pkg_resources
version_dict
=
{}
version_dict
=
{}
for
dist
in
pkg_resources
.
working_set
:
for
dist
in
pkg_resources
.
working_set
:
# pylint:disable=not-an-iterable
version_dict
[
dist
.
key
]
=
dist
.
version
version_dict
[
dist
.
key
]
=
dist
.
version
from
Products
import
ERP5
as
erp5_product
from
Products
import
ERP5
as
erp5_product
...
...
product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.SimulationTool.py
View file @
3bc593c9
...
@@ -2528,7 +2528,7 @@ class SimulationTool(BaseTool):
...
@@ -2528,7 +2528,7 @@ class SimulationTool(BaseTool):
simulation_movement
.
expand
(
expand_policy
=
'immediate'
)
simulation_movement
.
expand
(
expand_policy
=
'immediate'
)
# activate builder
# activate builder
movement_portal_type
,
=
movement_portal_type_set
movement_portal_type
,
=
movement_portal_type_set
# pylint:disable=unbalanced-tuple-unpacking
merged_builder
=
self
.
_findBuilderForDelivery
(
main_delivery
,
movement_portal_type
)
merged_builder
=
self
.
_findBuilderForDelivery
(
main_delivery
,
movement_portal_type
)
if
merged_builder
is
None
:
if
merged_builder
is
None
:
error_list
.
append
(
translateString
(
"Unable to find builder"
))
error_list
.
append
(
translateString
(
"Unable to find builder"
))
...
...
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