From abc44a50cbffdab7372e598f4a2f1fcf71b5e4f1 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 1 Feb 2010 17:16:05 +0530 Subject: [PATCH] [FIX] Custom fields should be removed from _columns too lp bug: https://launchpad.net/bugs/490125 fixed bzr revid: jvo@tinyerp.com-20100201114605-6klss5f5bqw5yb6o --- bin/addons/base/ir/ir_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index 29bd130a400..8b2c52a33a4 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -235,10 +235,12 @@ class ir_model_fields(osv.osv): def unlink(self, cr, user, ids, context=None): for field in self.browse(cr, user, ids, context): if field.state <> 'manual': - raise except_orm(_('Error'), _("You can not remove the field '%s' !") %(field.name,)) + raise except_orm(_('Error'), _("You cannot remove the field '%s' !") %(field.name,)) # # MAY BE ADD A ALTER TABLE DROP ? # + #Removing _columns entry for that table + self.pool.get(field.model)._columns.pop(field.name,None) return super(ir_model_fields, self).unlink(cr, user, ids, context) def create(self, cr, user, vals, context=None):