[FIX]:Properties should be deleted when the related record is deleted
lp bug: https://launchpad.net/bugs/891580 fixed bzr revid: nch@tinyerp.com-20111202102202-0jzzlqu68fypbbl3
This commit is contained in:
@@ -3659,6 +3659,13 @@ class BaseModel(object):
|
||||
self.check_unlink(cr, uid)
|
||||
|
||||
properties = self.pool.get('ir.property')
|
||||
##search if there are properties created with resource that is about to be deleted
|
||||
## if found delete the properties too.
|
||||
unlink_properties = properties.search(cr, uid, [('res_id', 'in', ['%s,%s' % (self._name, i) for i in ids])], context=context)
|
||||
if unlink_properties:
|
||||
properties.unlink(cr, uid, unlink_properties, context=context)
|
||||
|
||||
## check if the model is used as a default property
|
||||
domain = [('res_id', '=', False),
|
||||
('value_reference', 'in', ['%s,%s' % (self._name, i) for i in ids]),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user