It is currently Sat Feb 11, 2012 12:01 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Using signals
PostPosted: Mon Oct 20, 2008 10:32 am 
Offline

Joined: Mon Oct 20, 2008 10:10 am
Posts: 28
Hello.

I recently setup a workflow, just like the sales one:

draft -> button(signal) -> create something

The object creating a workflow instance is something like a position in an order and therefor (itself) created inside a one to many list of its parent.

After creating the (child) object, everything works fine, just until the parent is saved.
The buttons signal (as mentioned above) then is triggered for any child previously added to the parent that just was saved.

So... why is a child forms button signal sent when a parent is saved?
How can I modify this?
How can I programatically create/(listen to) a signal?

Thanks in advance.

P.S.: Maybe the link to "developer manual" on the forums "new topic" or edit pages should be updated to point to: http://www.openerp.com/wiki/index.php/D ... r%27s_Book
it currently points to an empty page:
http://tinyerp.org/wiki/index.php/Devel ... k/HomePage

EDIT- Removed Question:
What exactly does returning True or False from an action do to a workflow? (Answer found in sourcecode)


Top
 Profile  
 
 Post subject: I guess I just found the reason by accident
PostPosted: Tue Oct 21, 2008 12:36 pm 
Offline

Joined: Mon Oct 20, 2008 10:10 am
Posts: 28
When defining an activity like:
<record> (model="workflow.activity" id="...")
<field> (name="wkf_id" ref = "...")
<field>do_something</field> (name="name")
<field>function</field> (name="kind")
<field>do_something()</field> (name="action")
<field>OR</field> (name="split_mode")
<field>False</field> (name="flow_start")
<field>False</field> (name="flow_stop")
</record>

Edit: When submitting this message the fields attributes are cut off. So I pass them in brackets

The activity is written to the database having:
flow_start = True
flow_stop = True

Infact you can enter anything into the flow_start and flow_stop fields. As soon as one of those fields exists within the activity it is saved to the database as "True".

Refering to:
http://openerp.com/wiki/index.php/Devel ... owActivity

I would call this an unexpected behaviour...

If the action is an entry/exit point, it's surely right to call it upon saving the container (cause that is, when the children are saved/created to the database).

Cheers.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP