Discussion:
[Erp5-dev] odd problem with portal in portal_types actions
Lukasz Nowak
2006-09-13 10:54:56 UTC
Permalink
Hello,

Situation: ERP5 running fine. Accessing object type Person with condition in
actions like that:

python:portal.restrictedTraverse('accounting_module', None) is not None

Runs fine. But while accessing Organisation (while using erp5_accounting)
gives me traceback (attached). I do not know even how to hunt that problem.

Bye,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 392 10 60 int 37 fax: +48 32 392 10 61
https://ssl.ventis.com.pl/keys/lukasz.nowak.pub.asc
``Use the Source, Luke...''
-------------- next part --------------
Traceback (innermost last):

Module ZPublisher.Publish, line 101, in publish
099 | missing_name,
100 | dont_publish_class,
101>| request, bind=1)
102 |
103 | if result is not response:

Module ZPublisher.mapply, line 88, in mapply
086 |
087 | args=tuple(args)
088>| if debug is not None: return debug(object,args,context)
089 | else: return object(*args)

Module ZPublisher.Publish, line 39, in call_object
037 |
038 |def call_object(object, args, request):
039>| result=apply(object,args) # Type s<cr> to step into published object.
040 | return result
041 |

Module Products.CMFCore.PortalContent, line 117, in view
115 | """ Returns the default view even if index_html is overridden.
116 | """
117>| return self()
118 |
119 |InitializeClass(PortalContent)

Module Products.CMFCore.PortalContent, line 104, in __call__
102 | method = getattr(self, method_id)
103 | else:
104>| method = _getViewFor(self)
105 |
106 | if getattr(aq_base(method), 'isDocTemp', 0):

Module Products.ERP5Type.patches.CMFCoreUtils, line 45, in CMFCoreUtils_getViewFor
043 | if action.getId() == view or action.getCategory().endswith('_%s' % view):
044 | if _verifyActionPermissions(obj, action):
045>| if action.testCondition(context):
046 | target = action.action(context).strip()
047 | if target.startswith('/'):

Module Products.CMFCore.ActionInformation, line 236, in testCondition
234 | """
235 | if self.condition:
236>| return bool( self.condition(ec) )
237 | else:
238 | return True

Module Products.CMFCore.Expression, line 44, in __call__
042 | # ?? Maybe expressions should manipulate the security
043 | # context stack.
044>| res = compiled(econtext)
045 | if isinstance(res, Exception):
046 | raise res

Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__
045 | g = self._bind_used_names(econtext)
046 | g.update(self._globals)
047>| return eval(code, g, {})
048 |
049 |class _SecureModuleImporter:

Module Python expression "portal.restrictedTraverse('accounting_module', None) is not None", line 1, in <expression>
AttributeError: 'NoneType' object has no attribute 'restrictedTraverse'
Lukasz Nowak
2006-09-20 13:48:56 UTC
Permalink
Hello,
Post by Lukasz Nowak
Situation: ERP5 running fine. Accessing object type Person with condition
python:portal.restrictedTraverse('accounting_module', None) is not None
Runs fine. But while accessing Organisation (while using erp5_accounting)
gives me traceback (attached). I do not know even how to hunt that problem.
On fresh revision 10210 that bug do not occurs, I think that was mine
misconfiguration and/or tweaks problems.

Bye,
Luke
.
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 392 10 60 int 37 fax: +48 32 392 10 61
https://ssl.ventis.com.pl/keys/lukasz.nowak.pub.asc
``Use the Source, Luke...''
Loading...