Discussion:
[Erp5-dev] HowToCreateERP5TradeFromScratch problem
Shrenik Bhura
2006-05-12 12:07:01 UTC
Permalink
Hi!

I am trying to implement the ERP5 Trade as per the instructions in the
howto on the ERP5 LiveCD rc9 without the updated products from svn.

When I reach the "Change the state of order 000001" step, no applied
rule is created, nor any object in portal_simulation and the the log
returns the following error:

2006-05-12T13:57:34 INFO(0) WARNING ActivityTool Could not call method
updateAppliedRule on object ('', 'erp5_trade', 'order_module', '5')
Traceback (most recent call last):
File "/usr/lib/zope/lib/python/Products/CMFActivity/ActivityTool.py",
line 145, in __call__
result = getattr(obj, self.method_id)(*self.args, **self.kw)
File "/usr/lib/zope/lib/python/Products/ERP5/Document/Order.py", line
145, in updateAppliedRule
Delivery.updateAppliedRule(self, rule_id, force=force,**kw)
File "/usr/lib/zope/lib/python/Products/ERP5/Document/Delivery.py",
line 550, in updateAppliedRule
self._createAppliedRule(rule_id,force=force,**kw)
File "/usr/lib/zope/lib/python/Products/ERP5/Document/Delivery.py",
line 574, in _createAppliedRule
my_applied_rule = portal_rules[rule_id].\
File "/usr/lib/zope/lib/python/Products/ERP5/Document/Rule.py", line
92, in constructNewAppliedRule
context.newContent(id=id, portal_type='Applied Rule',
specialise_value=self,**kw)
File "/usr/lib/zope/lib/python/Products/ERP5Type/Document/Folder.py",
line 85, in newContent
is_indexable=is_indexable
File "/usr/lib/zope/lib/python/Products/CMFCore/TypesTool.py", line
930, in constructContent
ob = info.constructInstance(container, id, *args, **kw)
File "/usr/lib/zope/lib/python/Products/ERP5Type/ERP5Type.py", line
182, in constructInstance
ob = FactoryTypeInformation.constructInstance(
File "/usr/lib/zope/lib/python/Products/CMFCore/TypesTool.py", line
340, in constructInstance
ob = self._constructInstance(container, id, *args, **kw)
File "/usr/lib/zope/lib/python/Products/CMFCore/TypesTool.py", line
571, in _constructInstance
newid = m(id, *args, **kw)
File "/usr/lib/zope/lib/python/Products/ERP5Type/Utils.py", line 322,
in __call__
folder._setObject(id, o)
File "/usr/lib/zope/lib/python/Products/BTreeFolder2/BTreeFolder2.py",
line 419, in _setObject
object.manage_fixupOwnershipAfterAdd()
File "/usr/lib/zope/lib/python/AccessControl/Owned.py", line 254, in
manage_fixupOwnershipAfterAdd
self.changeOwnership(user)
File "/usr/lib/zope/lib/python/AccessControl/Owned.py", line 144, in
changeOwnership
new=ownerInfo(user)
File "/usr/lib/zope/lib/python/AccessControl/Owned.py", line 284, in
ownerInfo
db=user.aq_inner.aq_parent
AttributeError: aq_inner

and upon 'google'ing I found a problem/solution pair here:
http://mail.zope.org/pipermail/zope/2002-February/109619.html

I am not sure whether it is valid and/or how to apply it.

Am I required to checkout the latest Products or do you feel that it is
not required. I am a bit averse to checking out the latest due to some
constraints on the test machine.

Any advice in this regard shall be highly appreciated.

-SB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20060512/12c1518b/attachment.htm>
Jérôme Perrin
2006-05-12 12:42:30 UTC
Permalink
Post by Shrenik Bhura
Hi!
I am trying to implement the ERP5 Trade as per the instructions in the
howto on the ERP5 LiveCD rc9 without the updated products from svn.
When I reach the "Change the state of order 000001" step, no applied
rule is created, nor any object in portal_simulation and the the log
2006-05-12T13:57:34 INFO(0) WARNING ActivityTool Could not call method
File "/usr/lib/zope/lib/python/AccessControl/Owned.py", line 284, in
ownerInfo
db=user.aq_inner.aq_parent
AttributeError: aq_inner
Hi shrenik

When invoking an active message, CMFActivity get the user *in the portal*, but
your user might came from a parent acl_users (ie from /acl_users,
not /erp5/acl_users). In that case, ActivityTool cannot change the security
manager, and keeps original security manager (the user from the
zope_tic_loop, or "nothing" in case you use TimerService, which creates the
problem you describe).

This is fixed in svn, but this problem affected livecd 10.rc9 Products.
Here's the patch:
https://svn.erp5.org/erp5/trunk/products/CMFActivity/ActivityTool.py?r1=5768&r2=5969
Post by Shrenik Bhura
http://mail.zope.org/pipermail/zope/2002-February/109619.html
This is already done in ActivityTool.
--
J?rome
Shrenik Bhura
2006-05-13 10:22:44 UTC
Permalink
Thanks Jerome for your prompt response,

I have managed to proceed further but got stuck just a few steps later.

When the DeliveryBuilder is trying to create the packing list, I
encounter the following error:

PROBLEM(100) ActivityTool Could not call method build on object ('',
'erp5_trade', 'portal_deliveries', 'packing_list_builder')
Traceback (most recent call last):
File "/var/lib/zope/Products/CMFActivity/ActivityTool.py", line 177,
in __call__
result = getattr(obj, self.method_id)(*self.args, **self.kw)
File "/var/lib/zope/Products/ERP5/Document/OrderBuilder.py", line 113,
in build
movement_list = self.searchMovementList(
File "/var/lib/zope/Products/ERP5/Document/DeliveryBuilder.py", line
128, in searchMovementList
select_method = getattr(self.getPortalObject(),
self.simulation_select_method_id)
AttributeError: Order_selectMovement

even though the method Order_selectMovement exists.

I noticed that as per revision 6973, this functionality has been
modified 'to cut the acquisition chain' but I am unsure if that could be
a reason of this error.

Could this too be due to the fact that I am logged in as a user
from /acl_users and not /erp5/acl_users?

Regards,
-SB
Post by Jérôme Perrin
Post by Shrenik Bhura
Hi!
I am trying to implement the ERP5 Trade as per the instructions in the
howto on the ERP5 LiveCD rc9 without the updated products from svn.
When I reach the "Change the state of order 000001" step, no applied
rule is created, nor any object in portal_simulation and the the log
2006-05-12T13:57:34 INFO(0) WARNING ActivityTool Could not call method
File "/usr/lib/zope/lib/python/AccessControl/Owned.py", line 284, in
ownerInfo
db=user.aq_inner.aq_parent
AttributeError: aq_inner
Hi shrenik
When invoking an active message, CMFActivity get the user *in the portal*, but
your user might came from a parent acl_users (ie from /acl_users,
not /erp5/acl_users). In that case, ActivityTool cannot change the security
manager, and keeps original security manager (the user from the
zope_tic_loop, or "nothing" in case you use TimerService, which creates the
problem you describe).
This is fixed in svn, but this problem affected livecd 10.rc9 Products.
https://svn.erp5.org/erp5/trunk/products/CMFActivity/ActivityTool.py?r1=5768&r2=5969
Post by Shrenik Bhura
http://mail.zope.org/pipermail/zope/2002-February/109619.html
This is already done in ActivityTool.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20060513/07055334/attachment.htm>
Shrenik Bhura
2006-05-13 13:34:34 UTC
Permalink
Summarising my discussion with Jerome.

Though we did not manage a full-proof solution due to time constraints,
to get things moving we reverted back to the zope_tic_loop and the
delivery builder worked as desired.

It seems there is a problem related to the Timer service, the activities
and acquisition for the scripts in portal_skins.

If anyone would like to investigate this further please let me know and
I shall try to provide the desired information.

Regards,
SB
Post by Shrenik Bhura
Thanks Jerome for your prompt response,
I have managed to proceed further but got stuck just a few steps later.
When the DeliveryBuilder is trying to create the packing list, I
PROBLEM(100) ActivityTool Could not call method build on object ('',
'erp5_trade', 'portal_deliveries', 'packing_list_builder')
File "/var/lib/zope/Products/CMFActivity/ActivityTool.py", line 177,
in __call__
result = getattr(obj, self.method_id)(*self.args, **self.kw)
File "/var/lib/zope/Products/ERP5/Document/OrderBuilder.py", line
113, in build
movement_list = self.searchMovementList(
File "/var/lib/zope/Products/ERP5/Document/DeliveryBuilder.py", line
128, in searchMovementList
select_method = getattr(self.getPortalObject(),
self.simulation_select_method_id)
AttributeError: Order_selectMovement
even though the method Order_selectMovement exists.
I noticed that as per revision 6973, this functionality has been
modified 'to cut the acquisition chain' but I am unsure if that could
be a reason of this error.
Could this too be due to the fact that I am logged in as a user
from /acl_users and not /erp5/acl_users?
Regards,
-SB
Post by Jérôme Perrin
Post by Shrenik Bhura
Hi!
I am trying to implement the ERP5 Trade as per the instructions in the
howto on the ERP5 LiveCD rc9 without the updated products from svn.
When I reach the "Change the state of order 000001" step, no applied
rule is created, nor any object in portal_simulation and the the log
2006-05-12T13:57:34 INFO(0) WARNING ActivityTool Could not call method
File "/usr/lib/zope/lib/python/AccessControl/Owned.py", line 284, in
ownerInfo
db=user.aq_inner.aq_parent
AttributeError: aq_inner
Hi shrenik
When invoking an active message, CMFActivity get the user *in the portal*, but
your user might came from a parent acl_users (ie from /acl_users,
not /erp5/acl_users). In that case, ActivityTool cannot change the security
manager, and keeps original security manager (the user from the
zope_tic_loop, or "nothing" in case you use TimerService, which creates the
problem you describe).
This is fixed in svn, but this problem affected livecd 10.rc9 Products.
https://svn.erp5.org/erp5/trunk/products/CMFActivity/ActivityTool.py?r1=5768&r2=5969
Post by Shrenik Bhura
http://mail.zope.org/pipermail/zope/2002-February/109619.html
This is already done in ActivityTool.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20060513/cb103752/attachment.htm>
Jérôme Perrin
2006-05-15 08:22:42 UTC
Permalink
Post by Shrenik Bhura
Summarising my discussion with Jerome.
Though we did not manage a full-proof solution due to time constraints,
to get things moving we reverted back to the zope_tic_loop and the
delivery builder worked as desired.
TimerService is the recommanded choice, because activity management is 100%
zope based, without the need to start an external script; zope_tic_loop
should *not* be used now, unless you run old Products.
--
J?rome
Loading...