diff --git a/product/ERP5CPS/CPSDocumentPatch.py b/product/ERP5CPS/CPSDocumentPatch.py index 2058732652826d026383e25c5a789922240a0a01..a7a3064e8658cc094ce6cef33c443d944a864020 100755 --- a/product/ERP5CPS/CPSDocumentPatch.py +++ b/product/ERP5CPS/CPSDocumentPatch.py @@ -97,15 +97,18 @@ class PatchedCPSDocument(CPSDocument): security.declarePrivate('getLayoutAndSchema' ) def getLayoutAndSchema(self): - return (aq_base(self._getOb(".cps_layouts")),aq_base(self._getOb(".cps_schemas"))) + if hasattr(self,'.cps_layouts') and hasattr(self,'.cps_schemas'): + return (aq_base(self._getOb(".cps_layouts")),aq_base(self._getOb(".cps_schemas"))) + return None security.declarePrivate('setLayoutAndSchema' ) def setLayoutAndSchema(self, data): """ data must be : (layout,schema) """ - self._setOb(".cps_layouts",data[0]) - self._setOb(".cps_schemas",data[1]) + if data is not None: + self._setOb(".cps_layouts",data[0]) + self._setOb(".cps_schemas",data[1]) security.declarePrivate('_setProperty' ) def _setProperty(self, key, value, type='string'):