Discussion:
[Erp5-dev] erp5_csv_style global action prio patch
Łukasz Nowak
2007-09-13 11:05:03 UTC
Permalink
Hello,

I think that prio of import/export csv is too high - eg. on Sale
Packing List it is showed before packing.

Patch attached.

Regards,
Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erp5_csv-portal_properties-lower-prio.patch
Type: text/x-patch
Size: 888 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20070913/8b4f5c3a/attachment.bin>
Jérome Perrin
2007-09-14 07:35:21 UTC
Permalink
Post by Łukasz Nowak
Hello,
I think that prio of import/export csv is too high - eg. on Sale
Packing List it is showed before packing.
Hello,

The priority here is only used to order actions when installing them by
a business template (simply because business template system doesn't
keep ordering of subobjects).

When rendering actions, we use CMFCore's ActionsTool:

def listFilteredActionsFor(self, object=None):
...
# Include actions from specific tools.
for provider_name in self.listActionProviders():
provider = getattr(self, provider_name)
if IActionProvider.isImplementedBy(provider):
actions.extend( provider.listActionInfos(object=object)
...

'packing' action is from 'portal_types' action provider, csv actions are
from 'portal_properties' action provider. So for this case, only the
order of listActionProviders makes the difference.

I have put those csv "global" actions on portal_properties, because it
comes after portal_types in listActionProviders, to have csv actions
after portal type actions. ( The order of actions providers is
configured on portal_actions/manage_actionProviders )

So in theory this patch is not necessary

J?rome
Łukasz Nowak
2007-09-14 08:10:03 UTC
Permalink
Hello,

On 2007-09-14, 09:35:21
Post by Łukasz Nowak
Post by Łukasz Nowak
Hello,
I think that prio of import/export csv is too high - eg. on Sale
Packing List it is showed before packing.
Hello,
The priority here is only used to order actions when installing them
by a business template (simply because business template system
doesn't keep ordering of subobjects).
...
# Include actions from specific tools.
provider = getattr(self, provider_name)
actions.extend( provider.listActionInfos(object=object)
...
'packing' action is from 'portal_types' action provider, csv actions
are from 'portal_properties' action provider. So for this case, only
the order of listActionProviders makes the difference.
I have put those csv "global" actions on portal_properties, because
it comes after portal_types in listActionProviders, to have csv
actions after portal type actions. ( The order of actions providers
is configured on portal_actions/manage_actionProviders )
So in theory this patch is not necessary
OK, I'm sure your theory is correct :)

But I've set up fresh site, and actions from portal_properties was
shown before actions from portal_types. Used revision was 16327. I've
checked portal_actions/manage_actionProviders and portal_types is above
portal_properties - but changing its priority cause showing actions
from portal_properties before portal_actions on Sale Packing List
portal type. It might be may failure/misconfiguration - is anyone able
to reproduce it? (I'll do it myself in short time).

Luke
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...''
Loading...