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
c402fc83
Commit
c402fc83
authored
Aug 30, 2024
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Why?
parent
7824e4fa
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
34 deletions
+76
-34
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testWebDavSupport.py
...lateItem/portal_components/test.erp5.testWebDavSupport.py
+36
-25
bt5/erp5_interfaces/DocumentTemplateItem/portal_components/document.erp5.SOAPBinding.py
...mplateItem/portal_components/document.erp5.SOAPBinding.py
+17
-0
bt5/erp5_joblib/TestTemplateItem/portal_components/test.erp5.testJoblibActivityUseCase.py
.../portal_components/test.erp5.testJoblibActivityUseCase.py
+1
-1
bt5/erp5_stripe/TestTemplateItem/portal_components/test.erp5.testStripe.py
...estTemplateItem/portal_components/test.erp5.testStripe.py
+2
-0
product/ERP5Form/PlanningBox.py
product/ERP5Form/PlanningBox.py
+3
-3
product/ERP5OOo/tests/testDeferredStyle.py
product/ERP5OOo/tests/testDeferredStyle.py
+1
-1
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+1
-1
product/ERP5Type/dynamic/persistent_migration.py
product/ERP5Type/dynamic/persistent_migration.py
+7
-2
product/PortalTransforms/Transform.py
product/PortalTransforms/Transform.py
+8
-1
No files found.
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testWebDavSupport.py
View file @
c402fc83
...
...
@@ -85,11 +85,12 @@ class TestWebDavSupport(ERP5TypeTestCase):
person
=
self
.
portal
.
person_module
.
newContent
()
self
.
tic
()
file_object
=
self
.
makeFileUpload
(
'images/erp5_logo.png'
)
response
=
self
.
publish
(
person
.
getPath
()
+
'/erp5_logo.png'
,
request_method
=
'PUT'
,
stdin
=
file_object
,
basic
=
self
.
authentication
)
self
.
assertEqual
(
response
.
getStatus
(),
httplib
.
CREATED
)
response
=
self
.
publish
(
person
.
getPath
()
+
'/erp5_logo.png'
,
request_method
=
'PUT'
,
stdin
=
file_object
,
env
=
{
"CONTENT_TYPE"
:
'image/png'
},
basic
=
self
.
authentication
)
self
.
assertEqual
(
response
.
getStatus
(),
six
.
moves
.
http_client
.
CREATED
)
image
=
person
[
'erp5_logo.png'
]
self
.
assertEqual
(
image
.
getPortalType
(),
'Embedded File'
)
...
...
@@ -105,10 +106,12 @@ class TestWebDavSupport(ERP5TypeTestCase):
path
=
self
.
portal
.
portal_contributions
.
getPath
()
filename
=
'P-DMS-Presentation.3.Pages-001-en.odp'
file_object
=
self
.
makeFileUpload
(
filename
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
basic
=
self
.
authentication
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
env
=
{
"CONTENT_TYPE"
:
'application/vnd.oasis.opendocument.presentation'
},
basic
=
self
.
authentication
)
self
.
assertEqual
(
response
.
getStatus
(),
six
.
moves
.
http_client
.
CREATED
)
document_module
=
self
.
getDocumentModule
()
...
...
@@ -127,10 +130,12 @@ class TestWebDavSupport(ERP5TypeTestCase):
path
=
self
.
portal
.
portal_contributions
.
getPath
()
filename
=
'P-DMS-Presentation.3.Pages-001-en.odp'
file_object
=
self
.
makeFileUpload
(
filename
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
basic
=
self
.
authentication
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
env
=
{
"CONTENT_TYPE"
:
'application/vnd.oasis.opendocument.presentation'
},
basic
=
self
.
authentication
)
self
.
assertEqual
(
response
.
getStatus
(),
six
.
moves
.
http_client
.
CREATED
)
self
.
tic
()
...
...
@@ -199,10 +204,12 @@ class TestWebDavSupport(ERP5TypeTestCase):
path
=
self
.
portal
.
portal_contributions
.
getPath
()
filename
=
'P-DMS-Presentation.3.Pages-001-en.odp'
file_object
=
self
.
makeFileUpload
(
filename
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
basic
=
self
.
authentication
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
env
=
{
"CONTENT_TYPE"
:
'application/vnd.oasis.opendocument.presentation'
},
basic
=
self
.
authentication
)
# Convert to base format and run conversion into utf-8
self
.
tic
()
...
...
@@ -226,10 +233,12 @@ class TestWebDavSupport(ERP5TypeTestCase):
path
=
self
.
portal
.
portal_contributions
.
getPath
()
filename
=
'P-DMS-Presentation.3.Pages-001-en.odp'
file_object
=
self
.
makeFileUpload
(
filename
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
basic
=
self
.
authentication
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
env
=
{
"CONTENT_TYPE"
:
'application/vnd.oasis.opendocument.presentation'
},
basic
=
self
.
authentication
)
document_module
=
self
.
getDocumentModule
()
document
=
document_module
[
filename
]
...
...
@@ -264,10 +273,12 @@ class TestWebDavSupport(ERP5TypeTestCase):
path
=
self
.
portal
.
portal_contributions
.
getPath
()
filename
=
'P-DMS-Presentation.3.Pages-001-en.odp'
file_object
=
self
.
makeFileUpload
(
filename
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
basic
=
self
.
authentication
)
response
=
self
.
publish
(
'%s/%s'
%
(
path
,
filename
),
request_method
=
'PUT'
,
stdin
=
file_object
,
env
=
{
"CONTENT_TYPE"
:
'application/vnd.oasis.opendocument.presentation'
},
basic
=
self
.
authentication
)
document_module
=
self
.
getDocumentModule
()
document
=
document_module
[
filename
]
...
...
bt5/erp5_interfaces/DocumentTemplateItem/portal_components/document.erp5.SOAPBinding.py
View file @
c402fc83
...
...
@@ -31,6 +31,9 @@ from Products.ERP5Type import PropertySheet
from
Products.ERP5Type.Permissions
import
AccessContentsInformation
from
Products.ERP5Type.Base
import
Base
import
six
import
zope.component
import
zope.interface
from
ZPublisher.interfaces
import
IXmlrpcChecker
try
:
from
spyne
import
MethodContext
except
ImportError
:
...
...
@@ -42,6 +45,20 @@ else:
from
spyne.server.http
import
HttpBase
_default_xmrpc_checker
=
zope
.
component
.
queryUtility
(
IXmlrpcChecker
)
@
zope
.
interface
.
implementer
(
IXmlrpcChecker
)
def
soap_xmlrpc_checker
(
request
):
if
request
.
getHeader
(
'SOAPACTION'
):
return
False
return
_default_xmrpc_checker
is
None
or
_default_xmrpc_checker
(
request
)
zope
.
component
.
getGlobalSiteManager
().
registerUtility
(
soap_xmlrpc_checker
,
IXmlrpcChecker
)
class
SOAPBinding
(
Base
):
meta_type
=
'ERP5 SOAP Binding'
...
...
bt5/erp5_joblib/TestTemplateItem/portal_components/test.erp5.testJoblibActivityUseCase.py
View file @
c402fc83
...
...
@@ -40,7 +40,7 @@ class Test(ERP5TypeTestCase):
self
.
tic
()
active_process
=
self
.
portal
.
portal_activities
.
unrestrictedTraverse
(
path
)
result
=
active_process
.
getResultList
()
self
.
assertAlmostEqual
(
0.9
8444444444444446
,
result
[
0
].
result
)
self
.
assertAlmostEqual
(
0.9
,
result
[
0
].
result
,
0
)
def
test_UnderRootOfSquaresFunction
(
self
):
path
=
self
.
portal
.
Base_driverScriptSquareRoot
()
...
...
bt5/erp5_stripe/TestTemplateItem/portal_components/test.erp5.testStripe.py
View file @
c402fc83
...
...
@@ -476,6 +476,7 @@ class TestStripePaymentSession(ERP5TypeTestCase):
}).
encode
()
),
request_method
=
"POST"
,
env
=
{
'CONTENT_TYPE'
:
'application/json'
},
handle_errors
=
False
)
self
.
assertEqual
(
200
,
ret
.
getStatus
())
self
.
tic
()
...
...
@@ -672,6 +673,7 @@ class TestStripePaymentSession(ERP5TypeTestCase):
}).
encode
(),
),
request_method
=
"POST"
,
env
=
{
'CONTENT_TYPE'
:
'application/json'
},
handle_errors
=
False
)
self
.
assertEqual
(
200
,
ret
.
getStatus
())
self
.
tic
()
...
...
product/ERP5Form/PlanningBox.py
View file @
c402fc83
...
...
@@ -1390,7 +1390,7 @@ class BasicStructure:
portal_domains
=
getattr
(
self
.
form
,
'portal_domains'
,
None
)
if
(
portal_domains
is
None
or
\
portal_domains
.
_getOb
(
default_selection_lane_path
,
None
)
is
None
):
portal_domains
.
_getOb
(
str
(
default_selection_lane_path
)
,
None
)
is
None
):
default_selection_lane_path
=
self
.
lane_root_list
[
0
][
0
]
if
default_selection_lane_path
in
(
None
,
()):
...
...
@@ -1430,9 +1430,9 @@ class BasicStructure:
portal_domains
=
getattr
(
self
.
form
,
'portal_domains'
,
None
)
default_selection_report_path
=
self
.
report_root_list
[
0
][
0
].
split
(
'/'
,
1
)[
0
]
if
(
portal_categories
is
None
or
\
portal_categories
.
_getOb
(
default_selection_report_path
,
None
)
is
None
)
\
portal_categories
.
_getOb
(
str
(
default_selection_report_path
)
,
None
)
is
None
)
\
and
(
portal_domains
is
None
or
\
portal_domains
.
_getOb
(
default_selection_report_path
,
None
)
is
None
):
portal_domains
.
_getOb
(
str
(
default_selection_report_path
)
,
None
)
is
None
):
default_selection_report_path
=
self
.
report_root_list
[
0
][
0
]
self
.
selection_report_path
=
self
.
selection
.
getReportPath
(
...
...
product/ERP5OOo/tests/testDeferredStyle.py
View file @
c402fc83
...
...
@@ -391,7 +391,7 @@ class TestDeferredStyleBase(DeferredStyleTestCase):
# after they are saved to DB and automatically migrated. The getProperty
# above, which is also what ods_style does, only work after the report
# state is updated.
report
.
__setstate__
(
aq_base
(
getattr
(
skin_folder
,
report_form_name
)).
__getstate__
())
aq_base
(
report
)
.
__setstate__
(
aq_base
(
getattr
(
skin_folder
,
report_form_name
)).
__getstate__
())
self
.
assertEqual
(
report
.
getProperty
(
'title'
),
self
.
id
())
# Report section method
...
...
product/ERP5Type/dynamic/lazy_class.py
View file @
c402fc83
...
...
@@ -376,7 +376,7 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
for
key
,
value
in
six
.
iteritems
(
attribute_dict
):
setattr
(
klass
,
key
,
value
)
if
getattr
(
klass
.
__setstate__
,
'
im_func'
,
None
)
is
\
if
getattr
(
klass
.
__setstate__
,
'
__func__'
,
klass
.
__setstate__
)
is
\
persistent_migration
.
__setstate__
:
# optimization to reduce overhead of compatibility code
klass
.
__setstate__
=
persistent_migration
.
Base__setstate__
...
...
product/ERP5Type/dynamic/persistent_migration.py
View file @
c402fc83
...
...
@@ -34,6 +34,7 @@
# class may be copied in the pickle of the container, and we can't access it
# from __setstate__.
import
six
import
logging
,
re
from
AccessControl
import
ClassSecurityInfo
from
Acquisition
import
aq_base
...
...
@@ -42,6 +43,7 @@ from persistent import Persistent, wref
from
ZODB.serialize
import
ObjectWriter
,
ObjectReader
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Base
import
Base
,
TempBase
,
WorkflowMethod
from
zodbpickle
import
binary
log
=
logging
.
getLogger
(
'ERP5Type'
)
log
.
trace
=
lambda
*
args
,
**
kw
:
log
.
log
(
5
,
*
args
,
**
kw
)
...
...
@@ -96,7 +98,6 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
if
_setOb
:
if
isinstance
(
_setOb
,
WorkflowMethod
):
_setOb
=
_setOb
.
_m
import
six
if
six
.
get_unbound_function
(
_setOb
)
is
six
.
get_unbound_function
(
OFS_Folder
.
_setOb
):
self
.
lazy
=
Ghost
elif
klass
.
__module__
[:
7
]
==
'BTrees.'
and
klass
.
__name__
!=
'Length'
:
...
...
@@ -113,8 +114,12 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
self
.
do_migrate
=
args
!=
(
klass
.
__module__
,
klass
.
__name__
)
and
\
not
isOldBTree
(
'%s.%s'
%
args
)
unpickler
.
find_global
=
self
.
_get_class
if
six
.
PY3
:
unpickler
.
find_class
=
self
.
_get_class
return
self
.
_get_class
(
*
args
)
unpickler
.
find_global
=
find_global
if
six
.
PY3
:
unpickler
.
find_class
=
find_global
unpickler
.
load
()
# class
state
=
unpickler
.
load
()
if
isinstance
(
self
.
lazy
,
LazyPersistent
):
...
...
@@ -152,7 +157,7 @@ class PickleUpdater(ObjectReader, ObjectWriter, object):
def
persistent_id
(
self
,
obj
):
assert
type
(
obj
)
is
not
Ghost
oid
=
self
.
getOid
(
obj
)
if
type
(
oid
)
is
str
:
if
isinstance
(
oid
,
binary
)
:
try
:
return
self
.
oid_dict
[
oid
]
except
KeyError
:
...
...
product/PortalTransforms/Transform.py
View file @
c402fc83
...
...
@@ -22,7 +22,14 @@ from Products.PortalTransforms.transforms.broken import BrokenTransform
def
import_from_name
(
module_name
):
""" import and return a module by its name """
return
import_module
(
module_name
)
__traceback_info__
=
(
module_name
,)
m
=
import_module
(
module_name
)
try
:
for
sub
in
module_name
.
split
(
"."
)[
1
:]:
m
=
getattr
(
m
,
sub
)
except
AttributeError
as
e
:
raise
ImportError
(
str
(
e
))
return
m
def
make_config_persistent
(
kwargs
):
""" iterates on the given dictionnary and replace list by persistent 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