[PATCH 6 of 6 seda] [views] Deactivate relationwidget's creation form

Sylvain Thenault sylvain.thenault at logilab.fr
Fri Mar 24 10:48:42 CET 2017

# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1490347093 -3600
#      Fri Mar 24 10:18:13 2017 +0100
# Node ID f825b4f1b50447993bd0a262abea005b1f04a7a9
# Parent  5013e2e14e23bb22e446a94d2160ed3f4a4754d8
[views] Deactivate relationwidget's creation form

I don't like it and it doesn't work well.

Closes #17066566

diff --git a/cubicweb_seda/views/widgets.py b/cubicweb_seda/views/widgets.py
--- a/cubicweb_seda/views/widgets.py
+++ b/cubicweb_seda/views/widgets.py
@@ -22,10 +22,17 @@ from logilab.common.decorators import mo
 from cubicweb import tags, utils
 from cubicweb.uilib import js
 from cubicweb.web import formfields as ff, formwidgets as fw
 from cubicweb.web.views import ajaxcontroller, autoform, formrenderers
+from cubes.relationwidget import views as rwdg
+# deactivate relation widget's creation form by default, it causes some js error if e.g. there are
+# some calendar widgets. Also, we don't really want that from an UX POV, IMO.
+rwdg.SearchForRelatedEntitiesView.has_creation_form = False
 def configure_relation_widget(req, div, search_url, title, multiple, validate):
     """Build a javascript link to invoke a relation widget
     Widget will be linked to div `div`, with a title `title`. It will display selectable entities

More information about the saem-devel mailing list