From e2fa66b05df027c3d0977bccf6bb508f2cfc3669 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 24 Oct 2014 15:36:58 +0200 Subject: [PATCH] [FIX] web: avoid incoherent actual_mode after refresh When accessing an existing record in form mode directly (enter the url or refresh a page), the daterecord has not been initialized yet. This means that the value of actual_mode will be set to 'edit' before loading the current record (method _actualize_mode() called from do_show()). This was problematic for one2many fields that we loaded in edit mode, showing add/delete icons/buttons in readonly views. (opw 607910) Backport of 7ec7f1ba4088525f3ad612557757deae294fc688 for 7.0 and saas<6. (opw 627885) --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 201f472b800..b7e6d9225c8 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -253,7 +253,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.dataset.ids.push(state.id); } this.dataset.select_id(state.id); - this.do_show({ reload: warm }); + this.do_show(); } }, /**