Discussion:
[Erp5-dev] processing relations when deleting an object
bartek
2007-11-10 14:42:02 UTC
Permalink
Hello

Currently when an object to which some other objects are related is
being deleted the system blocks the operation; however, there may be
situtations when we'd like to do something else - like, edit relations
so that the objects are no longer related, or delete all the related
objects in a 'cascading' way.

I need something like this now, so the question is, what would be a
clean way to implement such a feature? Perhaps it could be a kind of a
configurable interaction, but which would be executed before
Object_hasRelation does its checks (I experimented with interaction
workflow, but if there are related objects that stage is not even reached).

What would you advise?

Bartek
--
"feelings affect productivity. (...) unhappy people write worse
software, and less of it."
Karl Fogel, "Producing Open Source Software"
Jean-Paul Smets
2007-11-10 18:22:38 UTC
Permalink
Hi,

My advice is simple: do not delete the object. Instead, do something
else, such as moving it to a specific state such as cancelled, archived,
etc.

Other approaches (such as the one you describe) easily lead to data
destruction or inconsistencies, especially whenever security is involved.

I suspect the problem you encounter is more a problem of functional
analysis rather than a technical problem.

Regards,

JPS.
Post by bartek
Hello
Currently when an object to which some other objects are related is
being deleted the system blocks the operation; however, there may be
situtations when we'd like to do something else - like, edit relations
so that the objects are no longer related, or delete all the related
objects in a 'cascading' way.
I need something like this now, so the question is, what would be a
clean way to implement such a feature? Perhaps it could be a kind of a
configurable interaction, but which would be executed before
Object_hasRelation does its checks (I experimented with interaction
workflow, but if there are related objects that stage is not even reached).
What would you advise?
Bartek
--
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
Loading...