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
Léo-Paul Géneau
erp5
Commits
2a54181c
Commit
2a54181c
authored
Aug 03, 2020
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: More modules migrated from ERP5/ERP5Type Products.
parent
7a8205c3
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
259 additions
and
41 deletions
+259
-41
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
...TemplateItem/portal_components/mixin.erp5.BuilderMixin.py
+1
-1
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.BusinessLink.py
...plateItem/portal_components/document.erp5.BusinessLink.py
+1
-1
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.TradeModelPath.py
...ateItem/portal_components/document.erp5.TradeModelPath.py
+1
-1
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.BusinessProcess.py
...teItem/portal_components/document.erp5.BusinessProcess.py
+1
-1
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.BaseExtensibleTraversableMixin.py
...l_components/mixin.erp5.BaseExtensibleTraversableMixin.py
+2
-2
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.ExtensibleTraversableMixin.py
...ortal_components/mixin.erp5.ExtensibleTraversableMixin.py
+29
-28
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.ExtensibleTraversableMixin.xml
...rtal_components/mixin.erp5.ExtensibleTraversableMixin.xml
+106
-0
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.ExplanationCache.py
...ateItem/portal_components/module.erp5.ExplanationCache.py
+6
-7
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.ExplanationCache.xml
...teItem/portal_components/module.erp5.ExplanationCache.xml
+110
-0
product/ERP5/bootstrap/erp5_core/bt/template_mixin_id_list
product/ERP5/bootstrap/erp5_core/bt/template_mixin_id_list
+1
-0
product/ERP5/bootstrap/erp5_core/bt/template_module_component_id_list
.../bootstrap/erp5_core/bt/template_module_component_id_list
+1
-0
No files found.
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.BuilderMixin.py
View file @
2a54181c
...
@@ -36,7 +36,7 @@ from erp5.component.document.Amount import Amount
...
@@ -36,7 +36,7 @@ from erp5.component.document.Amount import Amount
from
erp5.component.module.MovementGroup
import
MovementGroupNode
from
erp5.component.module.MovementGroup
import
MovementGroupNode
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5
.ExplanationCache
import
_getExplanationCache
from
erp5.component.module
.ExplanationCache
import
_getExplanationCache
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
Acquisition
import
aq_parent
,
aq_inner
from
Acquisition
import
aq_parent
,
aq_inner
...
...
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.BusinessLink.py
View file @
2a54181c
...
@@ -34,7 +34,7 @@ from AccessControl import ClassSecurityInfo
...
@@ -34,7 +34,7 @@ from AccessControl import ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
erp5.component.document.Path
import
Path
from
erp5.component.document.Path
import
Path
from
Products.ERP5Type.Core.Predicate
import
Predicate
from
Products.ERP5Type.Core.Predicate
import
Predicate
from
Products.ERP5
.ExplanationCache
import
_getExplanationCache
from
erp5.component.module
.ExplanationCache
import
_getExplanationCache
from
erp5.component.interface.IBusinessLink
import
IBusinessLink
from
erp5.component.interface.IBusinessLink
import
IBusinessLink
import
zope.interface
import
zope.interface
...
...
bt5/erp5_trade/DocumentTemplateItem/portal_components/document.erp5.TradeModelPath.py
View file @
2a54181c
...
@@ -33,7 +33,7 @@ from AccessControl import ClassSecurityInfo
...
@@ -33,7 +33,7 @@ from AccessControl import ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
erp5.component.document.Path
import
Path
from
erp5.component.document.Path
import
Path
from
Products.ERP5
.ExplanationCache
import
_getExplanationCache
from
erp5.component.module
.ExplanationCache
import
_getExplanationCache
from
erp5.component.interface.ITradeModelPath
import
ITradeModelPath
from
erp5.component.interface.ITradeModelPath
import
ITradeModelPath
from
erp5.component.interface.IArrowBase
import
IArrowBase
from
erp5.component.interface.IArrowBase
import
IArrowBase
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.BusinessProcess.py
View file @
2a54181c
...
@@ -34,7 +34,7 @@ from Products.ERP5Type import Permissions, PropertySheet
...
@@ -34,7 +34,7 @@ from Products.ERP5Type import Permissions, PropertySheet
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.XMLObject
import
XMLObject
from
erp5.component.document.Path
import
Path
from
erp5.component.document.Path
import
Path
from
Products.ERP5
.ExplanationCache
import
_getExplanationCache
,
_getBusinessLinkClosure
from
erp5.component.module
.ExplanationCache
import
_getExplanationCache
,
_getBusinessLinkClosure
from
erp5.component.module.MovementCollectionDiff
import
_getPropertyAndCategoryList
from
erp5.component.module.MovementCollectionDiff
import
_getPropertyAndCategoryList
from
erp5.component.interface.IBusinessProcess
import
IBusinessProcess
from
erp5.component.interface.IBusinessProcess
import
IBusinessProcess
from
erp5.component.interface.IArrowBase
import
IArrowBase
from
erp5.component.interface.IArrowBase
import
IArrowBase
...
...
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.BaseExtensibleTraversableMixin.py
View file @
2a54181c
...
@@ -35,7 +35,7 @@ from AccessControl import ClassSecurityInfo, getSecurityManager
...
@@ -35,7 +35,7 @@ from AccessControl import ClassSecurityInfo, getSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.CMFCore.utils
import
getToolByName
from
Products.CMFCore.utils
import
getToolByName
from
Products.ERP5Type.ExtensibleTraversable
import
ExtensibleTraversableMixI
n
from
erp5.component.mixin.ExtensibleTraversableMixin
import
ExtensibleTraversableMixi
n
from
Products.ERP5Type.Cache
import
getReadOnlyTransactionCache
from
Products.ERP5Type.Cache
import
getReadOnlyTransactionCache
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type.Globals
import
InitializeClass
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type
import
Permissions
...
@@ -44,7 +44,7 @@ from Products.ERP5Type.Globals import get_request
...
@@ -44,7 +44,7 @@ from Products.ERP5Type.Globals import get_request
# XXX: these duplicate ones in ERP5.Document
# XXX: these duplicate ones in ERP5.Document
_MARKER
=
[]
_MARKER
=
[]
class
BaseExtensibleTraversableMixin
(
ExtensibleTraversableMix
I
n
):
class
BaseExtensibleTraversableMixin
(
ExtensibleTraversableMix
i
n
):
"""
"""
This class provides a generic base mixin implementation of IExtensibleTraversable.
This class provides a generic base mixin implementation of IExtensibleTraversable.
...
...
product/ERP5
Type/ExtensibleTraversable
.py
→
product/ERP5
/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.ExtensibleTraversableMixin
.py
View file @
2a54181c
...
@@ -22,35 +22,36 @@
...
@@ -22,35 +22,36 @@
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
from
webdav.NullResource
import
NullResource
from
webdav.NullResource
import
NullResource
class
ExtensibleTraversableMixIn
:
class
ExtensibleTraversableMixin
:
def
__bobo_traverse__
(
self
,
request
,
name
):
"""
If no subobject is found through Folder API
then try to lookup the object by invoking _getExtensibleContent
"""
# Normal traversal
try
:
return
getattr
(
self
,
name
)
except
AttributeError
:
pass
def
__bobo_traverse__
(
self
,
request
,
name
):
try
:
"""
return
self
[
name
]
If no subobject is found through Folder API
except
KeyError
:
then try to lookup the object by invoking _getExtensibleContent
pass
"""
# Normal traversal
try
:
return
getattr
(
self
,
name
)
except
AttributeError
:
pass
try
:
document
=
self
.
getExtensibleContent
(
request
,
name
)
return
self
[
name
]
if
document
is
not
None
:
except
KeyError
:
return
aq_base
(
document
).
__of__
(
self
)
pass
document
=
self
.
getExtensibleContent
(
request
,
name
)
# Not found section
if
document
is
not
None
:
method
=
request
.
get
(
'REQUEST_METHOD'
,
'GET'
)
return
aq_base
(
document
).
__of__
(
self
)
if
not
method
in
(
'GET'
,
'POST'
):
return
NullResource
(
self
,
name
,
request
).
__of__
(
self
)
# Waaa. unrestrictedTraverse calls us with a fake REQUEST.
# There is proabably a better fix for this.
try
:
request
.
RESPONSE
.
notFoundError
(
"%s
\
n
%s"
%
(
name
,
method
))
except
AttributeError
:
raise
KeyError
,
name
# Not found section
ExtensibleTraversableMixIn
=
ExtensibleTraversableMixin
# Backward compatibility
method
=
request
.
get
(
'REQUEST_METHOD'
,
'GET'
)
\ No newline at end of file
if
not
method
in
(
'GET'
,
'POST'
):
return
NullResource
(
self
,
name
,
request
).
__of__
(
self
)
# Waaa. unrestrictedTraverse calls us with a fake REQUEST.
# There is proabably a better fix for this.
try
:
request
.
RESPONSE
.
notFoundError
(
"%s
\
n
%s"
%
(
name
,
method
))
except
AttributeError
:
raise
KeyError
,
name
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.ExtensibleTraversableMixin.xml
0 → 100644
View file @
2a54181c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Mixin Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ExtensibleTraversableMixin
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.ExtensibleTraversableMixin
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Mixin Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/ExplanationCache.py
→
product/ERP5/
bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.
ExplanationCache.py
View file @
2a54181c
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
##############################################################################
##############################################################################
from
collections
import
defaultdict
from
collections
import
defaultdict
from
zLOG
import
LOG
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type.Cache
import
transactional_cached
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
...
@@ -213,7 +212,7 @@ class ExplanationCache:
...
@@ -213,7 +212,7 @@ class ExplanationCache:
"""
"""
business_type_list = self.getPortalBusinessLinkTypeList()
business_type_list = self.getPortalBusinessLinkTypeList()
simulation_movement_list = self.getSimulationMovementValueList()
simulation_movement_list = self.getSimulationMovementValueList()
simulation_movement_uid_list =
map(lambda x:x.uid, simulation_movement_list)
simulation_movement_uid_list =
[x.uid for x in simulation_movement_list]
# We could use related keys instead of 2 queries
# We could use related keys instead of 2 queries
business_link_list = self.portal_catalog(
business_link_list = self.portal_catalog(
portal_type=business_type_list,
portal_type=business_type_list,
...
@@ -283,8 +282,8 @@ class ExplanationCache:
...
@@ -283,8 +282,8 @@ class ExplanationCache:
new_business_process = self.explanation.newContent(temp_object=True,
new_business_process = self.explanation.newContent(temp_object=True,
portal_type='
Business
Process
', id='
closure_business_process
')
portal_type='
Business
Process
', id='
closure_business_process
')
for i, x in enumerate(business_link_list):
for i, x in enumerate(business_link_list):
id = '
closure_path_
%
s
' % i
id
_
= '
closure_path_
%
s
' % i
new_business_process._setOb(id
, x.asContext(id=id
))
new_business_process._setOb(id
_, x.asContext(id=id_
))
self.closure_cache[path_list] = new_business_process
self.closure_cache[path_list] = new_business_process
self.closure_cache[business_link] = new_business_process
self.closure_cache[business_link] = new_business_process
...
@@ -306,8 +305,8 @@ class ExplanationCache:
...
@@ -306,8 +305,8 @@ class ExplanationCache:
i = 0
i = 0
for business_link in self.getBusinessLinkValueList():
for business_link in self.getBusinessLinkValueList():
i += 1
i += 1
id = '
union_path_
%
s
' % i
id
_
= '
union_path_
%
s
' % i
new_business_process._setOb(id
, business_link.asContext(id=id
))
new_business_process._setOb(id
_, business_link.asContext(id=id_
))
# Keep it in cache and return
# Keep it in cache and return
self.union_cache = new_business_process
self.union_cache = new_business_process
...
@@ -324,7 +323,7 @@ class ExplanationCache:
...
@@ -324,7 +323,7 @@ class ExplanationCache:
try:
try:
result = cache[reference_date_key]
result = cache[reference_date_key]
if result is self: # use self as marker to detect infinite recursion
if result is self: # use self as marker to detect infinite recursion
__traceback_info__ = (business_process.getPath(), trade_phase,
__traceback_info__ = (business_process.getPath(), trade_phase,
# pylint: disable=unused-variable
reference_date_method_id, delay_mode)
reference_date_method_id, delay_mode)
raise ValueError('
No
reference
date
is
defined
,
probably
due
to
missing
Trade
Model
Path
in
Business
Process
')
raise ValueError('
No
reference
date
is
defined
,
probably
due
to
missing
Trade
Model
Path
in
Business
Process
')
return result
return result
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.ExplanationCache.xml
0 → 100644
View file @
2a54181c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Module Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
ExplanationCache
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.ExplanationCache
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
module.erp5.ExplanationCache
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Module Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/bt/template_mixin_id_list
View file @
2a54181c
...
@@ -10,6 +10,7 @@ mixin.erp5.DocumentMixin
...
@@ -10,6 +10,7 @@ mixin.erp5.DocumentMixin
mixin.erp5.DocumentProxyMixin
mixin.erp5.DocumentProxyMixin
mixin.erp5.DownloadableMixin
mixin.erp5.DownloadableMixin
mixin.erp5.ExplainableMixin
mixin.erp5.ExplainableMixin
mixin.erp5.ExtensibleTraversableMixin
mixin.erp5.MailMessageMixin
mixin.erp5.MailMessageMixin
mixin.erp5.MovementCollectionUpdaterMixin
mixin.erp5.MovementCollectionUpdaterMixin
mixin.erp5.MovementGeneratorMixin
mixin.erp5.MovementGeneratorMixin
...
...
product/ERP5/bootstrap/erp5_core/bt/template_module_component_id_list
View file @
2a54181c
module.erp5.DateUtils
module.erp5.DateUtils
module.erp5.DiffUtils
module.erp5.DiffUtils
module.erp5.ExpandPolicy
module.erp5.ExpandPolicy
module.erp5.ExplanationCache
module.erp5.GeneratedAmountList
module.erp5.GeneratedAmountList
module.erp5.Log
module.erp5.Log
module.erp5.MovementCollectionDiff
module.erp5.MovementCollectionDiff
...
...
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