diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-04-18 12:14:53 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-04-18 12:14:53 +0200 |
| commit | 67054b6dcb82b47b4b2d8fc5daaf7b2d4f140b6c (patch) | |
| tree | 9aabf23f706fd0207d6ed8987f0c17fdb92be95d /addons/web/controllers | |
| parent | aab0908818ab4bee0af136d4e693a90ab1b2d261 (diff) | |
| parent | 2f037a13ca3a3f4e570f19b11af3e75acb9618d3 (diff) | |
[MERGE] forward port branch 10.0 up to 2f037a13ca3
Diffstat (limited to 'addons/web/controllers')
| -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 0e6f29aeff7..585cb2f36b7 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -928,14 +928,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.env['ir.ui.view.custom'] - CustomView.create({ - 'user_id': request.session.uid, - 'ref_id': view_id, - 'arch': arch - }) + @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): |
