Commit fe5e050b authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

Business Manger: Changes in Dynamic classes

parent 3e381243
...@@ -11,6 +11,7 @@ from Products.ERP5Type.Base import PropertyHolder, initializePortalTypeDynamicWo ...@@ -11,6 +11,7 @@ from Products.ERP5Type.Base import PropertyHolder, initializePortalTypeDynamicWo
from Products.ERP5Type.Utils import UpperCase from Products.ERP5Type.Utils import UpperCase
from Products.ERP5Type.Core.CategoryProperty import CategoryProperty from Products.ERP5Type.Core.CategoryProperty import CategoryProperty
from ExtensionClass import ExtensionClass, pmc_init_of from ExtensionClass import ExtensionClass, pmc_init_of
from Products.ERP5Type.Core.Folder import Folder
from zope.interface import classImplements from zope.interface import classImplements
from ZODB.broken import Broken, PersistentBroken from ZODB.broken import Broken, PersistentBroken
...@@ -333,7 +334,6 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -333,7 +334,6 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
# Do not load the class again if it has already been loaded # Do not load the class again if it has already been loaded
if not cls.__isghost__: if not cls.__isghost__:
return return
# cls might be a subclass of a portal type class # cls might be a subclass of a portal type class
# we need to find the right class to change # we need to find the right class to change
for klass in cls.__mro__: for klass in cls.__mro__:
...@@ -354,7 +354,10 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder): ...@@ -354,7 +354,10 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
LOG("ERP5Type.Dynamic", WARNING, LOG("ERP5Type.Dynamic", WARNING,
"Could not access Portal Type Object for type %r" "Could not access Portal Type Object for type %r"
% portal_type, error=sys.exc_info()) % portal_type, error=sys.exc_info())
base_tuple = (ERP5BaseBroken, ) # XXX: Add checks for testing if this is just during import and that too
# for module objects only, for other cases, the base_tuple should be
# ERP5Broken only in general
base_tuple = (Folder,)
portal_type_category_list = [] portal_type_category_list = []
attribute_dict = dict(_categories=[], constraints=[]) attribute_dict = dict(_categories=[], constraints=[])
interface_list = [] interface_list = []
......
...@@ -296,9 +296,11 @@ def synchronizeDynamicModules(context, force=False): ...@@ -296,9 +296,11 @@ def synchronizeDynamicModules(context, force=False):
the classes since the last reset on this node. the classes since the last reset on this node.
* with force=True, forcefully reset the classes on the current node * with force=True, forcefully reset the classes on the current node
and send out an invalidation to other nodes and send out an invalidation to other nodes
XXX: force=True doesn't reset or migrate as migration still is dependent
on `_bootstrapped` which already do have portal_id
""" """
portal = context.getPortalObject() portal = context.getPortalObject()
global last_sync global last_sync
if force: if force:
# hard invalidation to force sync between nodes # hard invalidation to force sync between nodes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment