Discussion:
[Erp5-dev] interaction workflow script on edit action and relation string fields updates
Jacek Medrzycki
2007-02-27 17:21:56 UTC
Permalink
Hi!

I have noticed the following behaviour:

I have an interaction workflow with the interaction triggered by the
edit action:

Trigger: WorkflowMethod
Scripts (after): ['someScript']
Methods : ['edit']

The "someScript" for now does nothing except logging.

Then I have a form for the A object, with RelationStringField for the
'destination' relation.

I have found, that when a user clears the Relation String Field and then
updates the relation by clicking the "gear box wheel" and picking the
value from the list, then my script gets an "old" value of the
'destination' relation (not the one the user have just chosen, but the
previous one).

Is it "a bug or a feature"?

How can I catch in interaction workflow a current value of relation
after user updates it? I need it to update security on related object. I
can not rely on user clicking the "save" button after updating the relation.

Jacek
Yoshinori Okuji
2007-02-27 17:29:54 UTC
Permalink
Post by Jacek Medrzycki
Hi!
I have an interaction workflow with the interaction triggered by the
Trigger: WorkflowMethod
Scripts (after): ['someScript']
Methods : ['edit']
The "someScript" for now does nothing except logging.
Then I have a form for the A object, with RelationStringField for the
'destination' relation.
I have found, that when a user clears the Relation String Field and then
updates the relation by clicking the "gear box wheel" and picking the
value from the list, then my script gets an "old" value of the
'destination' relation (not the one the user have just chosen, but the
previous one).
Is it "a bug or a feature"?
It is a feature, an inconvenient feature.
Post by Jacek Medrzycki
How can I catch in interaction workflow a current value of relation
after user updates it? I need it to update security on related object. I
can not rely on user clicking the "save" button after updating the relation.
Specify the setter as well as edit. Personally, I feel that it would be more
convenient if we always call edit.

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
Jacek Medrzycki
2007-02-27 20:11:03 UTC
Permalink
Post by Yoshinori Okuji
Specify the setter as well as edit. Personally, I feel that it would be more
convenient if we always call edit.
YO
Thank You for an answer.
How can I specify a setter? For a destination relation, I tried
setDestination and setDestinationValue (also with underscores) in
"trigger methods Id" field, but it seems not to work.

Jacek

Loading...