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
138
Merge Requests
138
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
022f6263
Commit
022f6263
authored
Dec 16, 2020
by
Aurel
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! merge into cmf_upgrade_versions
parent
4671bc8e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
35 deletions
+54
-35
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
...tTemplateItem/portal_components/test.erp5.testERP5Core.py
+20
-19
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
...tTemplateItem/portal_components/test.erp5.testERP5Type.py
+2
-1
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
...plateItem/portal_components/test.erp5.testTemplateTool.py
+1
-0
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.File.py
...umentTemplateItem/portal_components/document.erp5.File.py
+26
-11
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.py
...TemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.py
+3
-3
product/ERP5Type/dynamic/portal_type_class.py
product/ERP5Type/dynamic/portal_type_class.py
+1
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Core.py
View file @
022f6263
...
@@ -595,25 +595,26 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
...
@@ -595,25 +595,26 @@ class TestERP5Core(ERP5TypeTestCase, ZopeTestCase.Functional):
# now let's simulate a site just migrated from Zope 2.8 that's being
# now let's simulate a site just migrated from Zope 2.8 that's being
# accessed for the first time:
# accessed for the first time:
from
Products.ERP5
import
ERP5Site
from
Products.ERP5
import
ERP5Site
setSite
()
if
1
:
# BBB
# Sites from Zope2.8 don't have a site_manager yet.
setSite
()
del
self
.
portal
.
_components
# Sites from Zope2.8 don't have a site_manager yet.
self
.
assertIsNotNone
(
ERP5Site
.
_missing_tools_registered
)
del
self
.
portal
.
_components
ERP5Site
.
_missing_tools_registered
=
None
self
.
assertIsNotNone
(
ERP5Site
.
_missing_tools_registered
)
self
.
commit
()
ERP5Site
.
_missing_tools_registered
=
None
# check that we can't get any translation utility
self
.
commit
()
self
.
assertEqual
(
queryUtility
(
ITranslationDomain
,
'erp5_ui'
),
None
)
# check that we can't get any translation utility
# Now simulate first access. Default behaviour from
self
.
assertEqual
(
queryUtility
(
ITranslationDomain
,
'erp5_ui'
),
None
)
# ObjectManager is to raise a ComponentLookupError here:
# Now simulate first access. Default behaviour from
# ObjectManager is to raise a ComponentLookupError here:
setSite
(
self
.
portal
)
self
.
commit
()
setSite
(
self
.
portal
)
self
.
assertIsNotNone
(
ERP5Site
.
_missing_tools_registered
)
self
.
commit
()
# This should have automatically reconstructed the i18n utility
self
.
assertIsNotNone
(
ERP5Site
.
_missing_tools_registered
)
# registrations:
# This should have automatically reconstructed the i18n utility
self
.
assertEqual
(
queryUtility
(
ITranslationDomain
,
'erp5_ui'
),
# registrations:
erp5_ui_catalog
)
self
.
assertEqual
(
queryUtility
(
ITranslationDomain
,
'erp5_ui'
),
self
.
assertEqual
(
queryUtility
(
ITranslationDomain
,
'ui'
),
erp5_ui_catalog
)
erp5_ui_catalog
)
self
.
assertEqual
(
queryUtility
(
ITranslationDomain
,
'ui'
),
erp5_ui_catalog
)
def
test_BasicAuthenticateDesactivated
(
self
):
def
test_BasicAuthenticateDesactivated
(
self
):
"""Make sure Unauthorized error does not lead to Basic auth popup in browser"""
"""Make sure Unauthorized error does not lead to Basic auth popup in browser"""
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
View file @
022f6263
...
@@ -52,6 +52,7 @@ from AccessControl.ZopeGuards import guarded_getattr, guarded_hasattr
...
@@ -52,6 +52,7 @@ from AccessControl.ZopeGuards import guarded_getattr, guarded_hasattr
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
removeZODBPythonScript
from
Products.ERP5Type.tests.utils
import
removeZODBPythonScript
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
from
DateTime
import
DateTime
class
PropertySheetTestCase
(
ERP5TypeTestCase
):
class
PropertySheetTestCase
(
ERP5TypeTestCase
):
"""Base test case class for property sheets tests.
"""Base test case class for property sheets tests.
...
@@ -2479,7 +2480,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
...
@@ -2479,7 +2480,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
folder
=
self
.
getOrganisationModule
()
folder
=
self
.
getOrganisationModule
()
obj
=
folder
.
newContent
(
portal_type
=
'Organisation'
)
obj
=
folder
.
newContent
(
portal_type
=
'Organisation'
)
self
.
assertIsInstance
(
portal
.
creation_date
,
DateTime
)
self
.
assertIsInstance
(
portal
.
creation_date
,
DateTime
)
self
.
assertLess
(
portal
.
creation_date
,
obj
ect
.
getCreationDate
())
self
.
assertLess
(
portal
.
creation_date
,
obj
.
getCreationDate
())
self
.
assertIsNone
(
folder
.
getCreationDate
())
self
.
assertIsNone
(
folder
.
getCreationDate
())
def
test_copyWithoutModificationRight
(
self
):
def
test_copyWithoutModificationRight
(
self
):
...
...
bt5/erp5_forge/TestTemplateItem/portal_components/test.erp5.testTemplateTool.py
View file @
022f6263
...
@@ -34,6 +34,7 @@ import random
...
@@ -34,6 +34,7 @@ import random
import
tempfile
import
tempfile
from
xml.dom.minidom
import
getDOMImplementation
from
xml.dom.minidom
import
getDOMImplementation
from
App.config
import
getConfiguration
from
App.config
import
getConfiguration
from
Products.CMFCore.ActionsTool
import
ActionsTool
from
Products.ERP5.Document.BusinessTemplate
import
\
from
Products.ERP5.Document.BusinessTemplate
import
\
BusinessTemplateMissingDependency
BusinessTemplateMissingDependency
...
...
product/ERP5/ERP5Site.py
View file @
022f6263
...
@@ -2228,7 +2228,7 @@ class ERP5Generator(PortalGenerator):
...
@@ -2228,7 +2228,7 @@ class ERP5Generator(PortalGenerator):
# Set the 'custom' layer a high priority, so it remains the first
# Set the 'custom' layer a high priority, so it remains the first
# layer when installing new business templates.
# layer when installing new business templates.
ps
[
'custom'
].
manage_addProperty
(
"business_template_skin_layer_priority"
,
100.0
,
"float"
)
ps
[
'custom'
].
manage_addProperty
(
"business_template_skin_layer_priority"
,
100.0
,
"float"
)
skin_folders
=
', '
.
join
(
[
'custom'
,
'external_method'
]
)
skin_folders
=
', '
.
join
(
(
'custom'
,
'external_method'
)
)
ps
.
addSkinSelection
(
'View'
ps
.
addSkinSelection
(
'View'
,
skin_folders
,
skin_folders
,
make_default
=
1
,
make_default
=
1
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.File.py
View file @
022f6263
...
@@ -34,7 +34,7 @@ from erp5.component.document.Document import Document, VALID_TEXT_FORMAT_LIST
...
@@ -34,7 +34,7 @@ from erp5.component.document.Document import Document, VALID_TEXT_FORMAT_LIST
from
erp5.component.document.Document
import
VALID_IMAGE_FORMAT_LIST
from
erp5.component.document.Document
import
VALID_IMAGE_FORMAT_LIST
from
erp5.component.document.Document
import
ConversionError
from
erp5.component.document.Document
import
ConversionError
from
Products.ERP5Type.Base
import
Base
,
removeIContentishInterface
from
Products.ERP5Type.Base
import
Base
,
removeIContentishInterface
from
Products.CMFDefault.File
import
File
as
CMF
File
from
OFS.Image
import
File
as
OFS_
File
from
Products.ERP5Type.Utils
import
deprecated
from
Products.ERP5Type.Utils
import
deprecated
def
_unpackData
(
data
):
def
_unpackData
(
data
):
...
@@ -46,7 +46,7 @@ def _unpackData(data):
...
@@ -46,7 +46,7 @@ def _unpackData(data):
_MARKER
=
object
()
_MARKER
=
object
()
class
File
(
Document
,
CMF
File
):
class
File
(
Document
,
OFS_
File
):
"""
"""
A File can contain raw data which can be uploaded and downloaded.
A File can contain raw data which can be uploaded and downloaded.
It is the root class of Image, OOoDocument (ERP5OOo product),
It is the root class of Image, OOoDocument (ERP5OOo product),
...
@@ -110,8 +110,14 @@ class File(Document, CMFFile):
...
@@ -110,8 +110,14 @@ class File(Document, CMFFile):
filename
=
kw
.
get
(
'filename'
)
filename
=
kw
.
get
(
'filename'
)
if
filename
:
if
filename
:
self
.
_setFilename
(
filename
)
self
.
_setFilename
(
filename
)
if
self
.
_isNotEmpty
(
file_object
):
if
file_object
is
not
None
:
self
.
_setFile
(
file_object
,
precondition
=
precondition
)
# XXX: Rather than doing nothing if empty, consider changing:
# - _update_image_info to clear metadata
# - interactions to do nothing (or else?)
file_object
.
seek
(
0
,
2
)
if
file_object
.
tell
():
file_object
.
seek
(
0
)
self
.
_setFile
(
file_object
)
Base
.
_edit
(
self
,
**
kw
)
Base
.
_edit
(
self
,
**
kw
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'edit'
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'edit'
)
...
@@ -138,11 +144,15 @@ class File(Document, CMFFile):
...
@@ -138,11 +144,15 @@ class File(Document, CMFFile):
return
None
return
None
def
_setFile
(
self
,
data
,
precondition
=
None
):
def
_setFile
(
self
,
data
,
precondition
=
None
):
if
data
is
not
None
and
self
.
hasData
()
and
\
if
data
is
None
:
str
(
data
.
read
())
==
str
(
self
.
getData
()):
return
# Same data as previous, no need to change it's content
if
str
(
data
.
read
())
==
(
self
.
hasData
()
and
str
(
self
.
getData
())):
# Same data as previous, no need to change its content
return
return
CMFFile
.
_edit
(
self
,
precondition
=
precondition
,
file
=
data
)
if
data
.
tell
():
data
.
seek
(
0
)
self
.
manage_upload
(
data
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setFile'
)
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setFile'
)
def
setFile
(
self
,
data
,
precondition
=
None
):
def
setFile
(
self
,
data
,
precondition
=
None
):
...
@@ -176,11 +186,16 @@ class File(Document, CMFFile):
...
@@ -176,11 +186,16 @@ class File(Document, CMFFile):
return
str
(
data
)
return
str
(
data
)
# DAV Support
# DAV Support
PUT
=
CMFFile
.
PUT
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'PUT'
)
def
PUT
(
self
,
REQUEST
,
RESPONSE
):
"""from Products.CMFDefault.File"""
OFS_File
.
PUT
(
self
,
REQUEST
,
RESPONSE
)
self
.
reindexObject
()
security
.
declareProtected
(
Permissions
.
FTPAccess
,
'manage_FTPstat'
,
security
.
declareProtected
(
Permissions
.
FTPAccess
,
'manage_FTPstat'
,
'manage_FTPlist'
)
'manage_FTPlist'
)
manage_FTPlist
=
CMF
File
.
manage_FTPlist
manage_FTPlist
=
OFS_
File
.
manage_FTPlist
manage_FTPstat
=
CMF
File
.
manage_FTPstat
manage_FTPstat
=
OFS_
File
.
manage_FTPstat
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getMimeTypeAndContent'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getMimeTypeAndContent'
)
def
getMimeTypeAndContent
(
self
):
def
getMimeTypeAndContent
(
self
):
...
...
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/breadcrumbs.py
View file @
022f6263
...
@@ -6,13 +6,13 @@ utool = portal.portal_url
...
@@ -6,13 +6,13 @@ utool = portal.portal_url
portal_url
=
utool
()
portal_url
=
utool
()
param
=
'?ignore_layout:int=1'
if
int
(
portal
.
REQUEST
.
get
(
'ignore_layout'
,
0
))
else
''
param
=
'?ignore_layout:int=1'
if
int
(
portal
.
REQUEST
.
get
(
'ignore_layout'
,
0
))
else
''
if
include_root
:
if
include_root
:
result
=
[{
result
=
[{
'id'
:
'root'
,
'id'
:
'root'
,
'title'
:
portal
.
title
,
'title'
:
portal
.
title
,
'url'
:
'%s/view%s'
%
(
portal_url
,
param
),
'url'
:
'%s/view%s'
%
(
portal_url
,
param
),
}]
}]
else
:
else
:
result
=
[]
result
=
[]
obj
=
portal
obj
=
portal
now
=
[]
now
=
[]
...
@@ -23,7 +23,7 @@ for name in utool.getRelativeContentPath(context):
...
@@ -23,7 +23,7 @@ for name in utool.getRelativeContentPath(context):
getattr
(
obj
,
"getCompactTranslatedTitle"
,
lambda
:
None
)()
or
getattr
(
obj
,
"getCompactTranslatedTitle"
,
lambda
:
None
)()
or
obj
.
getTitle
()
or
obj
.
getId
()
obj
.
getTitle
()
or
obj
.
getId
()
)
)
if
name
!=
'talkback'
:
if
name
!=
'talkback'
:
result
.
append
(
{
'id'
:
name
result
.
append
(
{
'id'
:
name
,
'title'
:
title
,
'title'
:
title
,
'url'
:
'%s/%s/view%s'
%
(
portal_url
,
'/'
.
join
(
now
),
param
)
,
'url'
:
'%s/%s/view%s'
%
(
portal_url
,
'/'
.
join
(
now
),
param
)
...
...
product/ERP5Type/dynamic/portal_type_class.py
View file @
022f6263
...
@@ -490,6 +490,7 @@ def synchronizeDynamicModules(context, force=False):
...
@@ -490,6 +490,7 @@ def synchronizeDynamicModules(context, force=False):
portal
.
portal_skins
.
changeSkin
(
None
)
portal
.
portal_skins
.
changeSkin
(
None
)
TransactionalResource
(
tpc_finish
=
lambda
txn
:
TransactionalResource
(
tpc_finish
=
lambda
txn
:
_bootstrapped
.
add
(
portal
.
id
))
_bootstrapped
.
add
(
portal
.
id
))
transaction
.
get
().
note
(
'Site migrated'
)
LOG
(
'ERP5Site'
,
INFO
,
'Transition successful, please update your'
LOG
(
'ERP5Site'
,
INFO
,
'Transition successful, please update your'
' business templates'
)
' business templates'
)
else
:
else
:
...
...
Aurel
@aurel
mentioned in commit
f7445044
·
Jan 29, 2021
mentioned in commit
f7445044
mentioned in commit f74450449447a045c159970123b213f6d8657d93
Toggle commit list
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