From 8174407a30ec59dc66712ebd6973b74ec930ec93 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 7 Jul 2009 18:05:38 +0530 Subject: [PATCH] [FIX] Property : Removed old referenced values from property [openobject-server @ jvo@tinyerp.com-20090707123538-mg6fucnverqpyrz6] --- bin/openerp-server.py | 2 +- bin/osv/fields.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/openerp-server.py b/bin/openerp-server.py index a518f8a99..3971f2fa7 100644 --- a/bin/openerp-server.py +++ b/bin/openerp-server.py @@ -129,7 +129,7 @@ if tools.config["translate_out"]: tools.trans_export(tools.config["language"], tools.config["translate_modules"], buf, fileformat) buf.close() - logger.notifyChannel("init", netsvc.LOG_INFO, 'translation file written succesfully') + logger.notifyChannel("init", netsvc.LOG_INFO, 'translation file written successfully') sys.exit(0) if tools.config["translate_in"]: diff --git a/bin/osv/fields.py b/bin/osv/fields.py index 7d34f6860..4d1417b93 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -827,6 +827,14 @@ class property(function): int(prop.value.split(',')[1])) or False obj = obj.pool.get(self._obj) + existing_ids = obj.search(cr, uid, [('id','in',res.values())]) + deleted_ids = [] + + for res_id in res.values(): + if res_id and (res_id not in existing_ids): + if res_id not in deleted_ids: + cr.execute('DELETE FROM ir_property WHERE value=%s', ((obj._name+','+str(res_id)),)) + deleted_ids.append(res_id) names = dict(obj.name_get(cr, uid, filter(None, res.values()), context)) for r in res.keys(): if res[r] and res[r] in names: -- 2.11.4.GIT