Discussion:
[Erp5-dev] Using some global actions for actions common to all portal types
Jérome Perrin
2007-08-13 12:58:53 UTC
Permalink
Hi

Some actions like History, Medatada or Print PDF are defined on all
portal types. The idea is to replace those actions defined everywhere by
global actions.
I added those global actions in r15631 and r15632, so now we need to
remove actions from existing portal types, otherwise they are displayed
twice.

I will myself remove actions from the most common business templates,
but if you want to update your business templates, you can use the
attached script.

Call this script on the context of the business template, it will remove
actions from portal_types and in the business template itself, so that
you just have to export it again.

J?rome
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: BusinessTemplate_removeOldStyleActions.py
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20070813/c2fe53ae/attachment.asc>
Jean-Paul Smets
2007-08-13 13:51:21 UTC
Permalink
Quick note:
about Print "action", is it still possible to override the default
print action ?
(it OK for me to keep the default one in second).
JPS.
Post by Jérome Perrin
Hi
Some actions like History, Medatada or Print PDF are defined on all
portal types. The idea is to replace those actions defined everywhere
by global actions.
I added those global actions in r15631 and r15632, so now we need to
remove actions from existing portal types, otherwise they are
displayed twice.
I will myself remove actions from the most common business templates,
but if you want to update your business templates, you can use the
attached script.
Call this script on the context of the business template, it will remove
actions from portal_types and in the business template itself, so that
you just have to export it again.
J?rome
------------------------------------------------------------------------
_______________________________________________
Erp5-dev mailing list
Erp5-dev at erp5.org
http://erp5.org/mailman/listinfo/erp5-dev
--
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org
Jérome Perrin
2007-08-13 14:13:17 UTC
Permalink
Post by Jean-Paul Smets
about Print "action", is it still possible to override the default
print action ?
(it OK for me to keep the default one in second).
Actions from portal types will always be displayed before global
actions, but they will not replace global action.
This means that if you define a custom print (or search, export ...)
action for a given portal type, your portal type action will be the one
selected by default.

J?rome
Yoshinori Okuji
2007-08-13 15:46:00 UTC
Permalink
Post by Jérome Perrin
Post by Jean-Paul Smets
about Print "action", is it still possible to override the default
print action ?
(it OK for me to keep the default one in second).
Actions from portal types will always be displayed before global
actions, but they will not replace global action.
This means that if you define a custom print (or search, export ...)
action for a given portal type, your portal type action will be the one
selected by default.
Actually, I don't like the idea of having completely the same actions
everywhere. When I looked at a ODS export global action, it was even added to
portal_templates, and it was simply annoying for me. So we need to be a bit
more careful about where we want to enable global actions.

YO
--
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org
Jean-Paul Smets
2007-08-13 16:46:07 UTC
Permalink
Post by Yoshinori Okuji
Post by Jérome Perrin
Post by Jean-Paul Smets
about Print "action", is it still possible to override the default
print action ?
(it OK for me to keep the default one in second).
Actions from portal types will always be displayed before global
actions, but they will not replace global action.
This means that if you define a custom print (or search, export ...)
action for a given portal type, your portal type action will be the one
selected by default.
Actually, I don't like the idea of having completely the same actions
everywhere. When I looked at a ODS export global action, it was even added to
portal_templates, and it was simply annoying for me. So we need to be a bit
more careful about where we want to enable global actions.
What is the problem of having ODS export action for BT ?

JPS.
Post by Yoshinori Okuji
YO
--
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org
Jérome Perrin
2007-08-14 08:20:26 UTC
Permalink
Post by Jérome Perrin
Post by Jean-Paul Smets
about Print "action", is it still possible to override the default
print action ?
(it OK for me to keep the default one in second).
Actions from portal types will always be displayed before global
actions, but they will not replace global action.
This is actually too anoying, I will add a script that filter out
duplicate actions (ie. actions with the same ID from the same category).
This way you won't have duplicate actions, and it will be possible to
replace a global action.

J?rome
Jérome Perrin
2007-08-17 16:22:24 UTC
Permalink
Post by Jérome Perrin
I will add a script that filter out
duplicate actions (ie. actions with the same ID from the same category).
This way you won't have duplicate actions, and it will be possible to
replace a global action.
This is done in http://svn.erp5.org?rev=15737&view=rev

J?rome
Mikolaj Antoszkiewicz
2007-09-06 14:32:49 UTC
Permalink
Post by Jérome Perrin
Post by Jean-Paul Smets
about Print "action", is it still possible to override the default
print action ?
(it OK for me to keep the default one in second).
Actions from portal types will always be displayed before global
actions, but they will not replace global action.
This means that if you define a custom print (or search, export ...)
action for a given portal type, your portal type action will be the one
selected by default.
Should it be enough if I just add the 'print' action to the portal type, or do
I have to configure something for the form to execute my action not the
global one?
I've added 'print' action (as object_print category) to Sale Invoice
Transaction portal type, but clicking the printer icon still executes
standard Base_print ....

Mikolaj
Jérome Perrin
2007-09-10 16:43:23 UTC
Permalink
Post by Mikolaj Antoszkiewicz
Should it be enough if I just add the 'print' action to the portal type, or do
I have to configure something for the form to execute my action not the
global one?
I've added 'print' action (as object_print category) to Sale Invoice
Transaction portal type, but clicking the printer icon still executes
standard Base_print ....
Hi,
This was a bug, fixed by this commit:
http://svn.erp5.org?rev=16233&view=rev

J?rome

Loading...