[FIX] models: Always use MissingError when a document is missing
As done in write and already in next version (see 0fd773a), accessing a deleted record (through read or check access rights) should always return a MissingError instead of the generic except_orm. This will allow code ignoring deleted record (e.g. 'recompute' method) to safely process the other records. Fixes #6105
This commit is contained in:
parent
7d79520559
commit
2925bb5c9a
|
@ -3470,8 +3470,8 @@ class BaseModel(object):
|
||||||
# errors for non-transactional search/read sequences coming from clients
|
# errors for non-transactional search/read sequences coming from clients
|
||||||
return
|
return
|
||||||
_logger.warning('Failed operation on deleted record(s): %s, uid: %s, model: %s', operation, uid, self._name)
|
_logger.warning('Failed operation on deleted record(s): %s, uid: %s, model: %s', operation, uid, self._name)
|
||||||
raise except_orm(_('Missing document(s)'),
|
raise MissingError(
|
||||||
_('One of the documents you are trying to access has been deleted, please try again after refreshing.'))
|
_('One of the documents you are trying to access has been deleted, please try again after refreshing.'))
|
||||||
|
|
||||||
|
|
||||||
def check_access_rights(self, cr, uid, operation, raise_exception=True): # no context on purpose.
|
def check_access_rights(self, cr, uid, operation, raise_exception=True): # no context on purpose.
|
||||||
|
|
Loading…
Reference in New Issue