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
Paul Graydon
erp5
Commits
97a54fdf
Commit
97a54fdf
authored
Oct 10, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete unused code.
parent
fec552ee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
136 deletions
+0
-136
product/ERP5/Document/OrderLine.py
product/ERP5/Document/OrderLine.py
+0
-21
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+0
-15
product/ERP5Form/Report.py
product/ERP5Form/Report.py
+0
-12
product/ERP5Type/Tool/TypesTool.py
product/ERP5Type/Tool/TypesTool.py
+0
-88
No files found.
product/ERP5/Document/OrderLine.py
View file @
97a54fdf
...
@@ -56,24 +56,3 @@ class OrderLine(DeliveryLine):
...
@@ -56,24 +56,3 @@ class OrderLine(DeliveryLine):
,
PropertySheet
.
VariationRange
,
PropertySheet
.
VariationRange
,
PropertySheet
.
ItemAggregation
,
PropertySheet
.
ItemAggregation
)
)
def
applyToOrderLineRelatedMovement
(
self
,
portal_type
=
'Simulation Movement'
,
method_id
=
'expand'
):
"""
Warning: does not work if it was not catalogued immediately
"""
# XXX This method seems to be not used at all.
# Find related in simulation
for
my_simulation_movement
in
self
.
getOrderRelatedValueList
(
portal_type
=
'Simulation Movement'
)
or
\
self
.
getDeliveryRelatedValueList
(
portal_type
=
'Simulation Movement'
):
# And apply
getattr
(
my_simulation_movement
,
method_id
)()
for
c
in
self
.
contentValues
(
filter
=
{
'portal_type'
:
'Delivery Cell'
}):
for
my_simulation_movement
in
c
.
getOrderRelatedValueList
(
portal_type
=
'Simulation Movement'
)
or
\
c
.
getDeliveryRelatedValueList
(
portal_type
=
'Simulation Movement'
):
# And apply
getattr
(
my_simulation_movement
,
method_id
)()
product/ERP5/ERP5Site.py
View file @
97a54fdf
...
@@ -1593,21 +1593,6 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -1593,21 +1593,6 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
key
=
(
'default_reindex_parameter'
,
)
key
=
(
'default_reindex_parameter'
,
)
return
tv
.
get
(
key
)
return
tv
.
get
(
key
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'getERP5SiteGlobalId'
)
def
getERP5SiteGlobalId
(
self
):
"""Returns site global ID without any fallback"""
return
getattr
(
self
,
'erp5_site_global_id'
,
None
)
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'setERP5SiteGlobalId'
)
def
setERP5SiteGlobalId
(
self
,
global_id
):
"""Sets site global ID, only in case if not set yet
Such id should be very big and random, for example uuid version 4, as
defined in RFC 4122.
"""
if
self
.
getERP5SiteGlobalId
()
in
[
None
,
''
]:
self
.
erp5_site_global_id
=
global_id
security
.
declareProtected
(
Permissions
.
ManagePortal
,
security
.
declareProtected
(
Permissions
.
ManagePortal
,
'migrateToPortalTypeClass'
)
'migrateToPortalTypeClass'
)
def
migrateToPortalTypeClass
(
self
):
def
migrateToPortalTypeClass
(
self
):
...
...
product/ERP5Form/Report.py
View file @
97a54fdf
...
@@ -167,18 +167,6 @@ def add_and_edit(self, id, REQUEST):
...
@@ -167,18 +167,6 @@ def add_and_edit(self, id, REQUEST):
u
=
"%s/%s"
%
(
u
,
quote
(
id
))
u
=
"%s/%s"
%
(
u
,
quote
(
id
))
REQUEST
.
RESPONSE
.
redirect
(
u
+
'/manage_main'
)
REQUEST
.
RESPONSE
.
redirect
(
u
+
'/manage_main'
)
def
manage_add_report
(
self
,
id
,
title
=
""
,
unicode_mode
=
0
,
REQUEST
=
None
):
"""Add form to folder.
id -- the id of the new form to add
title -- the title of the form to add
Result -- empty string
"""
# add actual object
id
=
self
.
_setObject
(
id
,
ZMIForm
(
id
,
title
,
unicode_mode
))
# respond to the add_and_edit button if necessary
add_and_edit
(
self
,
id
,
REQUEST
)
return
''
class
ReportSection
:
class
ReportSection
:
""" A section in an ERP5Report.
""" A section in an ERP5Report.
...
...
product/ERP5Type/Tool/TypesTool.py
View file @
97a54fdf
...
@@ -255,40 +255,6 @@ class TypesTool(TypeProvider):
...
@@ -255,40 +255,6 @@ class TypesTool(TypeProvider):
from
Products.ERP5Type
import
interfaces
from
Products.ERP5Type
import
interfaces
return
[
name
for
name
,
cls
in
inspect
.
getmembers
(
interfaces
,
inspect
.
isclass
)]
return
[
name
for
name
,
cls
in
inspect
.
getmembers
(
interfaces
,
inspect
.
isclass
)]
security
.
declareProtected
(
Permissions
.
AddPortalContent
,
'listDefaultTypeInformation'
)
def
listDefaultTypeInformation
(
self
):
# FIXME: This method is only used by manage_addTypeInformation below, and
# should be removed when that method starts raising NotImplementedError.
#
# Scans for factory_type_information attributes
# of all products and factory dispatchers within products.
import
Products
res
=
[]
products
=
self
.
aq_acquire
(
'_getProducts'
)()
for
product
in
products
.
objectValues
():
product_id
=
product
.
getId
()
if
hasattr
(
aq_base
(
product
),
'factory_type_information'
):
ftis
=
product
.
factory_type_information
else
:
package
=
getattr
(
Products
,
product_id
,
None
)
dispatcher
=
getattr
(
package
,
'__FactoryDispatcher__'
,
None
)
ftis
=
getattr
(
dispatcher
,
'factory_type_information'
,
None
)
if
ftis
is
not
None
:
if
callable
(
ftis
):
ftis
=
ftis
()
for
fti
in
ftis
:
mt
=
fti
.
get
(
'meta_type'
,
None
)
id
=
fti
.
get
(
'id'
,
''
)
if
mt
:
p_id
=
'%s: %s (%s)'
%
(
product_id
,
id
,
mt
)
res
.
append
(
(
p_id
,
fti
)
)
return
res
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'resetDynamicDocumentsOnceAtTransactionBoundary'
)
'resetDynamicDocumentsOnceAtTransactionBoundary'
)
def
resetDynamicDocumentsOnceAtTransactionBoundary
(
self
):
def
resetDynamicDocumentsOnceAtTransactionBoundary
(
self
):
...
@@ -320,60 +286,6 @@ class TypesTool(TypeProvider):
...
@@ -320,60 +286,6 @@ class TypesTool(TypeProvider):
"""
"""
synchronizeDynamicModules
(
self
,
force
=
True
)
synchronizeDynamicModules
(
self
,
force
=
True
)
security
.
declareProtected
(
Permissions
.
AddPortalContent
,
'manage_addTypeInformation'
)
def
manage_addTypeInformation
(
self
,
add_meta_type
,
id
=
None
,
typeinfo_name
=
None
,
RESPONSE
=
None
):
# FIXME: This method is deprecated and should be reimplemented as a blocker
# i.e. a method that always raises a NotImplementedError
"""
Create a TypeInformation in self.
This method is mainly a copy/paste of CMF Types Tool
which means that the entire file is ZPLed for now.
"""
if
add_meta_type
!=
'ERP5 Type Information'
or
RESPONSE
is
not
None
:
raise
ValueError
fti
=
None
if
typeinfo_name
:
info
=
self
.
listDefaultTypeInformation
()
# Nasty workaround to stay backwards-compatible
# This workaround will disappear in CMF 1.7
if
typeinfo_name
.
endswith
(
')'
):
# This is a new-style name. Proceed normally.
for
name
,
ft
in
info
:
if
name
==
typeinfo_name
:
fti
=
ft
break
else
:
# Attempt to work around the old way
# This attempt harbors the problem that the first match on
# meta_type will be used. There could potentially be more
# than one TypeInformation sharing the same meta_type.
warnings
.
warn
(
'Please switch to the new format for typeinfo names '
'
\
"
product_id: type_id (meta_type)
\
"
, the old '
'spelling will disappear in CMF 1.7'
,
DeprecationWarning
,
stacklevel
=
2
)
ti_prod
,
ti_mt
=
[
x
.
strip
()
for
x
in
typeinfo_name
.
split
(
':'
)]
for
name
,
ft
in
info
:
if
name
.
startswith
(
ti_prod
)
and
name
.
endswith
(
'(%s)'
%
ti_mt
):
fti
=
ft
break
if
fti
is
None
:
raise
ValueError
(
'%s not found.'
%
typeinfo_name
)
if
not
id
:
id
=
fti
.
get
(
'id'
)
if
not
id
:
raise
ValueError
(
'An id is required.'
)
type_info
=
self
.
newContent
(
id
,
'Base Type'
)
if
fti
:
if
'actions'
in
fti
:
warnings
.
warn
(
'manage_addTypeInformation does not create default'
' actions automatically anymore.'
)
type_info
.
__dict__
.
update
((
k
,
v
)
for
k
,
v
in
fti
.
iteritems
()
if
k
not
in
(
'id'
,
'actions'
))
def
_finalizeMigration
(
self
):
def
_finalizeMigration
(
self
):
"""Compatibility code to finalize migration from CMF Types Tool"""
"""Compatibility code to finalize migration from CMF Types Tool"""
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
...
...
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