From 7e0ff24ccac15b0074c6a31cbf65411fd39c56a6 Mon Sep 17 00:00:00 2001 From: Thomas Groutars Date: Thu, 12 Mar 2015 18:29:00 +0100 Subject: [PATCH] [FIX] base: delete cascade value mapping on server action deletion When deleting a server action, its fields_lines were not deleted. It causes an issue for example in this case: Create a new custom field on any model Create a server action with Action To Do: Write on a Record Base model: model of the custom field Add a line in the value mapping, using the custom field you just created Delete the server action Delete the custom field => Throws an error because required field col1 is not defined on the ir_server_object_lines object --- openerp/addons/base/ir/ir_actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index c8abbf4f226..7dcdb5ce279 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -1035,7 +1035,7 @@ class ir_server_object_lines(osv.osv): _sequence = 'ir_actions_id_seq' _columns = { - 'server_id': fields.many2one('ir.actions.server', 'Related Server Action'), + 'server_id': fields.many2one('ir.actions.server', 'Related Server Action', ondelete='cascade'), 'col1': fields.many2one('ir.model.fields', 'Field', required=True), 'value': fields.text('Value', required=True, help="Expression containing a value specification. \n" "When Formula type is selected, this field may be a Python expression "