Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

[分享]几个查询工作流数据的SQL



  • 下面是经常用的几个查询工作流数据的SQL,比界面上查询用着顺,就写下来了<br />--查询某个工作流的activity和transition<br />select <br />a.name,a.osv,a.on_create,<br />d.id,d.condition,d.group_id,d.signal,<br />b.id as from_act_id,b.name as from_action,b.split_mode,b.join_mode,b.kind,<br />c.id as to_act_id,c.name as to_action,c.split_mode,c.join_mode,c.kind<br />from wkf a<br />join wkf_activity b on a.id = b.wkf_id<br />join wkf_activity c on a.id = c.wkf_id<br />join wkf_transition d on b.id = d.act_from and c.id = d.act_to<br />where a.osv = 'sale.order'<br />--and b.name in('sent' ,'router', 'wait_invoice','wait_ship','ship')<br />order by b.name<br /><br />--查询某个对象的工作流实例的workitem<br />select a.inst_id,a.act_id,c.name as act_name,a.state, c.split_mode,c.join_mode,c.kind<br />from wkf_workitem a<br />join wkf_instance b on a.inst_id = b.id<br />join wkf_activity c on a.act_id = c.id<br />where b.res_type = 'sale.order'<br />and b.res_id = 53<br /><br />--查询某个对象的工作流实例的log<br />select a.* ,b.name as act_name<br />from wkf_logs a<br />join wkf_activity b on a.act_id = b.id<br />where res_id = 53 and res_type = 'sale.order'



  • 下面是经常用的几个查询工作流数据的SQL,比界面上查询用着顺,就写下来了<br />--查询某个工作流的activity和transition<br />select <br />a.name,a.osv,a.on_create,<br />d.id,d.condition,d.group_id,d.signal,<br />b.id as from_act_id,b.name as from_action,b.split_mode,b.join_mode,b.kind,<br />c.id as to_act_id,c.name as to_action,c.split_mode,c.join_mode,c.kind<br />from wkf a<br />join wkf_activity b on a.id = b.wkf_id<br />join wkf_activity c on a.id = c.wkf_id<br />join wkf_transition d on b.id = d.act_from and c.id = d.act_to<br />where a.osv = 'sale.order'<br />--and b.name in('sent' ,'router', 'wait_invoice','wait_ship','ship')<br />order by b.name<br /><br />--查询某个对象的工作流实例的workitem<br />select a.inst_id,a.act_id,c.name as act_name,a.state, c.split_mode,c.join_mode,c.kind<br />from wkf_workitem a<br />join wkf_instance b on a.inst_id = b.id<br />join wkf_activity c on a.act_id = c.id<br />where b.res_type = 'sale.order'<br />and b.res_id = 53<br /><br />--查询某个对象的工作流实例的log<br />select a.* ,b.name as act_name<br />from wkf_logs a<br />join wkf_activity b on a.act_id = b.id<br />where res_id = 53 and res_type = 'sale.order'



  • 嗯. 工作流的重置状态 很需要啊...<br /><br />一个方法,给定一个对象,ID以及当前状态, 将工作流激活. 这一个方法很重要.<br /><br />推荐将SQL化为 method, 然后 就OK了.



  • 对,这个只是查询,OpenERP的工作流架构很不错,但是维护界面离产品化还是有一定差距


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待