[FIX] base: fix unlink_if_refcount traceback

Before this commit, a traceback was raised with 'local variable
referenced before assigment'

This commit closes #13848
This commit is contained in:
Jeremy Kersten
2016-10-18 14:18:11 +02:00
parent 67ad7a3452
commit 4128ab641c
+1
View File
@@ -1233,6 +1233,7 @@ class IrModelData(models.Model):
_logger.info('Unable to force processing of workflow for item %s@%s in order to leave activity to be deleted', res_id, model, exc_info=True)
def unlink_if_refcount(to_unlink):
global undeletable
for model, res_id in to_unlink:
external_ids = self.search([('model', '=', model), ('res_id', '=', res_id)])
if external_ids - datas: