odoo/odoo — pull request #1678 by sebalix (2014-08-08 12:33:50+00:00)
Title: [FIX] web_diagram, unlink connectors/transitions between nodes from the diagram view

When editing a diagram view (workflow or a marketing campaign for instance), an `AssertionError` is raised when removing a transition between two nodes.

The traceback:
```python
Traceback (most recent call last):
File "/home/odoo/odoo/server/openerp/http.py", line 476, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/odoo/server/openerp/http.py", line 495, in dispatch
result = self._call_function(**self.params)
File "/home/odoo/odoo/server/openerp/http.py", line 311, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/home/odoo/odoo/server/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/home/odoo/odoo/server/openerp/http.py", line 308, in checked_call
return self.endpoint(*a, **kw)
File "/home/odoo/odoo/server/openerp/http.py", line 685, in __call__
return self.method(*args, **kw)
File "/home/odoo/odoo/server/openerp/http.py", line 360, in response_wrap
response = f(*args, **kw)
File "/home/odoo/odoo/server/addons/web/controllers/main.py", line 940, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/odoo/odoo/server/addons/web/controllers/main.py", line 932, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/home/odoo/odoo/server/openerp/api.py", line 204, in wrapper
return old_api(self, *args, **kwargs)
File "/home/odoo/odoo/server/openerp/models.py", line 3517, in unlink
self.delete_workflow(cr, uid, ids, context=context)
File "/home/odoo/odoo/server/openerp/api.py", line 204, in wrapper
return old_api(self, *args, **kwargs)
File "/home/odoo/odoo/server/openerp/models.py", line 3444, in delete_workflow
workflow.trg_delete(uid, self._name, res_id, cr)
File "/home/odoo/odoo/server/openerp/workflow/__init__.py", line 63, in trg_delete
return WorkflowService.new(cr, uid, res_type, res_id).delete()
File "/home/odoo/odoo/server/openerp/workflow/service.py", line 37, in new
return cls(Session(cr, uid), Record(model_name, record_id))
File "/home/odoo/odoo/server/openerp/workflow/helpers.py", line 13, in __init__
assert isinstance(record_id, (int, long))
AssertionError
```

I think it's because the web controller method in the `web_diagram` module (`DiagramView.get_diagram_info`) is sending transitions/connectors IDs to the web client as strings instead of integers (IDs of nodes are integers, no problem). As such these IDs are returned to the server as a list of strings (e.g `['1']`).