Odoo中文网|Odoo实施培训

标题: 查询工作流数据的几个SQL [打印本页]

作者: 半九十    时间: 2015-9-2 17:28
标题: 查询工作流数据的几个SQL
查询某个工作流的activity和transition
select
a.name,a.osv,a.on_create,
d.id,d.condition,d.group_id,d.signal,
b.id as from_act_id,b.name as from_action,b.split_mode,b.join_mode,b.kind,
c.id as to_act_id,c.name as to_action,c.split_mode,c.join_mode,c.kind
from wkf a
join wkf_activity b on a.id = b.wkf_id
join wkf_activity c on a.id = c.wkf_id
join wkf_transition d on b.id = d.act_from and c.id = d.act_to
where a.osv = ‘sale.order’
–and b.name in(‘sent’ ,’router’, ‘wait_invoice’,'wait_ship’,'ship’)
order by b.name
–查询某个对象的工作流实例的workitem
select a.inst_id,a.act_id,c.name as act_name,a.state, c.split_mode,c.join_mode,c.kind
from wkf_workitem a
join wkf_instance b on a.inst_id = b.id
join wkf_activity c on a.act_id = c.id
where b.res_type = ‘sale.order’
and b.res_id = 53
–查询某个对象的工作流实例的log
select a.* ,b.name as act_name
from wkf_logs a
join wkf_activity b on a.act_id = b.id
where res_id = 53 and res_type = ‘sale.order’
                                                                                                






欢迎光临 Odoo中文网|Odoo实施培训 (http://www.chinaodoo.net/) Powered by Discuz! X3.2