diff options
Diffstat (limited to 'addons/web/controllers/main.py')
| -rw-r--r-- | addons/web/controllers/main.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 2ac11d1c1e4..d8cb0e6a36f 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -930,14 +930,18 @@ class DataSet(http.Controller): class View(http.Controller): - @http.route('/web/view/add_custom', type='json', auth="user") - def add_custom(self, view_id, arch): - CustomView = request.session.model('ir.ui.view.custom') - CustomView.create({ - 'user_id': request.session.uid, - 'ref_id': view_id, - 'arch': arch - }, request.context) + @http.route('/web/view/edit_custom', type='json', auth="user") + def edit_custom(self, custom_id, arch): + """ + Edit a custom view + + :param int custom_id: the id of the edited custom view + :param str arch: the edited arch of the custom view + :returns: dict with acknowledged operation (result set to True) + """ + + custom_view = request.env['ir.ui.view.custom'].browse(custom_id) + custom_view.write({ 'arch': arch }) return {'result': True} class TreeView(View): |
