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
Binh
erp5
Commits
e177f02f
Commit
e177f02f
authored
Aug 21, 2019
by
Bryton Lacquement
🚪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
6ff0893f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
33 deletions
+57
-33
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+1
-1
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+39
-23
product/ERP5Form/tests/testFields.py
product/ERP5Form/tests/testFields.py
+2
-2
product/ERP5Type/patches/CMFCoreSkinnable.py
product/ERP5Type/patches/CMFCoreSkinnable.py
+3
-5
product/ERP5Type/patches/WorkflowTool.py
product/ERP5Type/patches/WorkflowTool.py
+11
-0
product/ERP5Type/tests/testCookieCrumbler.py
product/ERP5Type/tests/testCookieCrumbler.py
+1
-2
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
e177f02f
...
@@ -2049,7 +2049,7 @@ class RegisteredSkinSelectionTemplateItem(BaseTemplateItem):
...
@@ -2049,7 +2049,7 @@ class RegisteredSkinSelectionTemplateItem(BaseTemplateItem):
update_dict
=
kw
.
get
(
'object_to_update'
)
update_dict
=
kw
.
get
(
'object_to_update'
)
force
=
kw
.
get
(
'force'
)
force
=
kw
.
get
(
'force'
)
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
skin_tool
=
getToolByName
(
portal
,
'portal_skins'
)
skin_tool
=
portal
.
portal_skins
for
skin_folder_id
in
self
.
_objects
.
keys
():
for
skin_folder_id
in
self
.
_objects
.
keys
():
...
...
product/ERP5/ERP5Site.py
View file @
e177f02f
...
@@ -322,7 +322,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -322,7 +322,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
from
Products.Localizer.MessageCatalog
import
(
from
Products.Localizer.MessageCatalog
import
(
message_catalog_alias_sources
message_catalog_alias_sources
)
)
sm
=
self
.
getSiteManager
()
sm
=
self
.
_components
for
message_catalog
in
self
.
Localizer
.
objectValues
():
for
message_catalog
in
self
.
Localizer
.
objectValues
():
sm
.
registerUtility
(
message_catalog
,
sm
.
registerUtility
(
message_catalog
,
provided
=
ITranslationDomain
,
provided
=
ITranslationDomain
,
...
@@ -332,21 +332,25 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -332,21 +332,25 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
provided
=
ITranslationDomain
,
provided
=
ITranslationDomain
,
name
=
alias
)
name
=
alias
)
def
_doInitialSiteManagerMigration
(
self
):
def
_registerMissingTools
(
self
):
self
.
_createInitialSiteManager
()
from
Products.CMFCore
import
interfaces
,
utils
# Now that we have a sitemanager, se can do things that require
sm
=
self
.
_components
# one. Including setting up ZTK style utilities and adapters. We
for
tool_id
,
tool_interface
in
utils
.
_tool_interface_registry
.
iteritems
():
# can even call setSite(self), as long as we roll back that later,
if
tool_interface
not
in
(
# since we are actually in the middle of a setSite() call.
interfaces
.
ISkinsTool
,
from
zope.site.hooks
import
getSite
,
setSite
interfaces
.
ITypesTool
,
old_site
=
getSite
()
interfaces
.
IMembershipTool
,
try
:
interfaces
.
IURLTool
,
setSite
(
self
)
interfaces
.
IWorkflowTool
,
# setSite(self) is not really necessary for the migration below, but
):
continue
# could be needed by other migrations to be added here.
self
.
_doTranslationDomainRegistration
()
# XXX: need to find the proper API to access "self.tool_id"
finally
:
tool
=
getattr
(
self
,
tool_id
,
None
)
setSite
(
old_site
)
if
tool
is
not
None
:
# Note: already registered tools will be either:
# - updated
# - registered again after being unregistered
sm
.
registerUtility
(
aq_base
(
tool
),
tool_interface
)
# backward compatibility auto-migration
# backward compatibility auto-migration
def
getSiteManager
(
self
):
def
getSiteManager
(
self
):
...
@@ -364,13 +368,25 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -364,13 +368,25 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
# as cheap as it is on the case that self._components is already
# as cheap as it is on the case that self._components is already
# set.
# set.
_components
=
self
.
_components
_components
=
self
.
_components
if
_components
is
not
None
:
if
_components
is
None
:
return
_components
# only create _components
# This method below can take as (reasonably) long as it pleases
self
.
_createInitialSiteManager
()
# since it will not be run ever again
_components
=
self
.
_components
self
.
_doInitialSiteManagerMigration
()
# Now that we have a sitemanager, se can do things that require
assert
self
.
_components
is
not
None
,
'Migration Failed!'
# one. Including setting up ZTK style utilities and adapters. We
return
self
.
_components
# can even call setSite(self), as long as we roll back that later,
# since we are actually in the middle of a setSite() call.
from
zope.site.hooks
import
getSite
,
setSite
old_site
=
getSite
()
try
:
setSite
(
self
)
self
.
_doTranslationDomainRegistration
()
self
.
_registerMissingTools
()
finally
:
setSite
(
old_site
)
else
:
self
.
_registerMissingTools
()
return
_components
security
.
declareProtected
(
Permissions
.
View
,
'view'
)
security
.
declareProtected
(
Permissions
.
View
,
'view'
)
def
view
(
self
):
def
view
(
self
):
...
...
product/ERP5Form/tests/testFields.py
View file @
e177f02f
...
@@ -642,8 +642,8 @@ class TestProxyField(ERP5TypeTestCase):
...
@@ -642,8 +642,8 @@ class TestProxyField(ERP5TypeTestCase):
ERP5Form
(
'Base_viewProxyFieldLibrary'
,
'Proxys'
))
ERP5Form
(
'Base_viewProxyFieldLibrary'
,
'Proxys'
))
self
.
container
.
_setObject
(
'Base_view'
,
self
.
container
.
_setObject
(
'Base_view'
,
ERP5Form
(
'Base_view'
,
'View'
))
ERP5Form
(
'Base_view'
,
'View'
))
from
Products.CMFCore.tests.base.utils
import
_setUpDefaultTraversable
#
from Products.CMFCore.tests.base.utils import _setUpDefaultTraversable
_setUpDefaultTraversable
()
#
_setUpDefaultTraversable()
def
addField
(
self
,
form
,
id
,
title
,
field_type
):
def
addField
(
self
,
form
,
id
,
title
,
field_type
):
...
...
product/ERP5Type/patches/CMFCoreSkinnable.py
View file @
e177f02f
...
@@ -141,11 +141,9 @@ def CMFCoreSkinnableSkinnableObjectManager_changeSkin(self, skinname, REQUEST=No
...
@@ -141,11 +141,9 @@ def CMFCoreSkinnableSkinnableObjectManager_changeSkin(self, skinname, REQUEST=No
Patched not to call getSkin.
Patched not to call getSkin.
'''
'''
if
skinname
is
None
:
if
skinname
is
None
:
sfn
=
self
.
getSkinsFolderName
()
sf
=
getattr
(
self
,
"portal_skins"
,
None
)
if
sfn
is
not
None
:
if
sf
is
not
None
:
sf
=
getattr
(
self
,
sfn
,
None
)
skinname
=
sf
.
getDefaultSkin
()
if
sf
is
not
None
:
skinname
=
sf
.
getDefaultSkin
()
tid
=
get_ident
()
tid
=
get_ident
()
SKINDATA
[
tid
]
=
(
SKINDATA
[
tid
]
=
(
None
,
None
,
...
...
product/ERP5Type/patches/WorkflowTool.py
View file @
e177f02f
...
@@ -979,4 +979,15 @@ def canDoActionFor(self, ob, action, wf_id=None, guard_kw={}):
...
@@ -979,4 +979,15 @@ def canDoActionFor(self, ob, action, wf_id=None, guard_kw={}):
WorkflowTool
.
canDoActionFor
=
canDoActionFor
WorkflowTool
.
canDoActionFor
=
canDoActionFor
security
.
declarePrivate
(
'_listTypeInfo'
)
def
_listTypeInfo
(
self
):
""" List the portal types which are available.
"""
ttool
=
getattr
(
self
.
getPortalObject
(),
"portal_types"
,
None
)
if
ttool
is
not
None
:
return
ttool
.
listTypeInfo
()
return
()
WorkflowTool
.
_listTypeInfo
=
_listTypeInfo
InitializeClass
(
WorkflowTool
)
InitializeClass
(
WorkflowTool
)
product/ERP5Type/tests/testCookieCrumbler.py
View file @
e177f02f
...
@@ -20,8 +20,7 @@ from OFS.DTMLMethod import DTMLMethod
...
@@ -20,8 +20,7 @@ from OFS.DTMLMethod import DTMLMethod
from
OFS.Folder
import
Folder
from
OFS.Folder
import
Folder
from
AccessControl.User
import
UserFolder
from
AccessControl.User
import
UserFolder
from
Products.CMFCore.CookieCrumbler
\
from
Products.CMFCore.CookieCrumbler
import
CookieCrumbler
,
manage_addCC
import
CookieCrumbler
,
manage_addCC
,
Redirect
from
Products.CMFCore.tests.test_CookieCrumbler
import
makerequest
from
Products.CMFCore.tests.test_CookieCrumbler
import
makerequest
from
Products.CMFCore.tests.test_CookieCrumbler
import
CookieCrumblerTests
from
Products.CMFCore.tests.test_CookieCrumbler
import
CookieCrumblerTests
...
...
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