From 4ba7214abcdd19f679790171a44ab9aedcd73b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 21 Aug 2009 09:12:25 +0200 Subject: [PATCH] Add call to ModelStorage.delete when changing id of actions --- trytond/ir/action.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trytond/ir/action.py b/trytond/ir/action.py index b929315928..83a652cb6b 100644 --- a/trytond/ir/action.py +++ b/trytond/ir/action.py @@ -1,7 +1,7 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. "Action" -from trytond.model import ModelView, ModelSQL, fields +from trytond.model import ModelView, ModelSQL, ModelStorage, fields from trytond.tools import file_open, Cache from trytond.backend import TableHandler import base64 @@ -343,6 +343,7 @@ class ActionReport(ModelSQL, ModelView): new_id = report.action.id cursor.execute('UPDATE "' + self._table + '" SET id = %s ' \ 'WHERE id = %s', (report.action.id, report.id)) + ModelStorage.delete(self, cursor, user, report.id) self.write(cursor, user, new_id, later, context=context) return new_id @@ -446,6 +447,7 @@ class ActionActWindow(ModelSQL, ModelView): new_id = act_window.action.id cursor.execute('UPDATE "' + self._table + '" SET id = %s ' \ 'WHERE id = %s', (act_window.action.id, act_window.id)) + ModelStorage.delete(self, cursor, user, act_window.id) self.write(cursor, user, new_id, later, context=context) return new_id @@ -522,6 +524,7 @@ class ActionWizard(ModelSQL, ModelView): new_id = wizard.action.id cursor.execute('UPDATE "' + self._table + '" SET id = %s ' \ 'WHERE id = %s', (wizard.action.id, wizard.id)) + ModelStorage.delete(self, cursor, user, wizard.id) self.write(cursor, user, new_id, later, context=context) return new_id @@ -667,6 +670,7 @@ class ActionURL(ModelSQL, ModelView): new_id = url.action.id cursor.execute('UPDATE "' + self._table + '" SET id = %s ' \ 'WHERE id = %s', (url.action.id, url.id)) + ModelStorage.delete(self, cursor, user, url.id) self.write(cursor, user, new_id, later, context=context) return new_id