深入理解OpenERP的工作流(Workflow)
-
迁移(Transition)的定义漏了权限组group_id,修正如下。表示只有该权限组可以触发本迁移。
迁移的完整 XML 定义格式如下。
<record model="workflow.transition" id="transition_id">
<field name="act_from" ref="activity_id_1"/>
<field name="act_to" ref="activity_id_2"/>
<field name="group_id" ref="groupid"/>
<field name="signal">(...)</field>
<field name="condition">(...)</field>
<field name="trigger_model">(...)</field>
<field name="trigger_expr_id">(...)</field>
</record> -
上文关于Trigger model和Trigger expr_id的解释不够清楚,更清楚的解释参看链接:http://www.openerp.com/forum/post82154.html#p82154
原文部分摘抄如下:
I'll explain here what these two fields do: trigger_model and trigger_expr_id, for people looking for help :
- These fields let you ask for an "evaluation" of the condition when a specific object changed.
For example, suppose you want to set a Sale Order into the state "Done" once it has been shipped. The first the time the condition will be evaluated, it will be False. But later (some days after), we will confirm the shipping order. But our workflow condition is not checked again. Unless you define trigger_model and trigger_expr_id.
- Trigger model: The object type which will trigger an evaluation of your condition.
- Trigger expr_id: A list of model ids which will trigger the condition.
For example, to take the example of our Sale Order, we don't want to check the condition each time a shipping order is confirmed, but only when the shipping order associated to our sale order is confirmed !
Note: You can put a call to a function into trigger_expr_id, like <field name="trigger_expr_id">get_shipping_ids()</field>, or you can directly put a python value (like in my example in the previous post).
WARNING: Currently (OpenERP 6.0) you can only use trigger_model and trigger_expr_id a few objects: account.move.line, procurement.order and stock.move ! -
关于Transition这一条好象没有介绍
end of a subflow through a selected activity of subflow,而这种用得还比较多。 -
<field name="group_id" ref="base.group_hr_user"/>
请问:
工作流中,设置用户组的时候,group_id 设置为base.group_hr_user 表示 “人力资源 / Officer”,我自己新建的组的标识 在哪里个表中可以查到 -
mark