[FIX] Property : Removed old referenced values from property

lp bug: https://launchpad.net/bugs/389795 fixed

bzr revid: jvo@tinyerp.com-20090707123538-mg6fucnverqpyrz6
This commit is contained in:
Jay,Uco 2009-07-07 18:05:38 +05:30 committed by Jay (Open ERP)
parent 9540e16bb6
commit a2db1c09ba
2 changed files with 9 additions and 1 deletions

View File

@ -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"]:

View File

@ -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: