[FIX] workflow: insertion of duplicates in many2many relation

This commit is contained in:
Raphael Collet 2017-06-26 14:44:20 +02:00
parent fe73fc442c
commit a1f1f85be2
1 changed files with 1 additions and 1 deletions

View File

@ -242,7 +242,7 @@ class WorkflowItem(object):
transitions.append((transition['id'], self.workitem['inst_id']))
if test and transitions:
cr.executemany('insert into wkf_witm_trans (trans_id,inst_id) values (%s,%s)', transitions)
cr.executemany('insert into wkf_witm_trans (trans_id,inst_id) values (%s,%s) except (select trans_id,inst_id from wkf_witm_trans)', transitions)
cr.execute('delete from wkf_workitem where id=%s', (self.workitem['id'],))
for t in transitions:
self._join_test(t[0], t[1], stack)