raise ValueError('No such external ID currently defined in the system: %s.%s' % (module, xml_id))
return res['model'], res['res_id']
- def check_object_reference(self, cr, uid, module, xml_id):
++ def check_object_reference(self, cr, uid, module, xml_id, raise_on_access_error=False):
+ """Returns (model, res_id) corresponding to a given module and xml_id (cached), if and only if the user has the necessary access rights
- to see that object, otherwise raise ValueError"""
++ to see that object, otherwise raise a ValueError if raise_on_access_error is True or returns a tuple (model found, False)"""
+ model, res_id = self.get_object_reference(cr, uid, module, xml_id)
+ #search on id found in result to check if current user has read access right
+ check_right = self.pool.get(model).search(cr, uid, [('id', '=', res_id)])
+ if check_right:
+ return model, res_id
- raise ValueError('Not enough access rights on the external ID: %s.%s' % (module, xml_id))
++ if raise_on_access_error:
++ raise ValueError('Not enough access rights on the external ID: %s.%s' % (module, xml_id))
++ return model, False
+
def get_object(self, cr, uid, module, xml_id, context=None):
"""Returns a browsable record for the given module name and xml_id or raise ValueError if not found"""
res_model, res_id = self.get_object_reference(cr, uid, module, xml_id)
# properly comparable using normal operarors, for example:
# (6,1,0,'beta',0) < (6,1,0,'candidate',1) < (6,1,0,'candidate',2)
# (6,1,0,'candidate',2) < (6,1,0,'final',0) < (6,1,2,'final',0)
--version_info = (7, 0, 0, FINAL, 0)
++version_info = (8, 0, 0, ALPHA, 1)
version = '.'.join(map(str, version_info[:2])) + RELEASE_LEVELS_DISPLAY[version_info[3]] + str(version_info[4] or '')
serie = major_version = '.'.join(map(str, version_info[:2]))
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.socket.setblocking(0)
self.socket.bind(self.address)
-- self.socket.listen(8)
++ self.socket.listen(8*self.population)
# long polling socket
self.long_polling_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.long_polling_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)