[views/clone] On copying an archive unit, hide its underlying alternative
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 07 Mar 2017 18:48:31 +0100
changeset 2467 5c94d0712e11
parent 2466 26bd2acc7285
child 2470 cce71e0d5639
[views/clone] On copying an archive unit, hide its underlying alternative using yet another custom afs.
cubicweb_seda/views/archiveunit.py
--- a/cubicweb_seda/views/archiveunit.py	Tue Mar 07 18:47:52 2017 +0100
+++ b/cubicweb_seda/views/archiveunit.py	Tue Mar 07 18:48:31 2017 +0100
@@ -22,7 +22,7 @@
 from logilab.common.decorators import monkeypatch
 
 from cubicweb import tags, _
-from cubicweb.predicates import is_instance
+from cubicweb.predicates import is_instance, match_form_params
 from cubicweb.view import EntityView
 from cubicweb.web.views import autoform, baseviews, tabs, uicfg
 
@@ -1104,3 +1104,7 @@
     __select__ = (widgets.NoTitleEntityInlinedFormRenderer.__select__
                   & is_instance('SEDADataObjectReference')
                   & simplified_profile())
+
+
+copy_afs = copy_rtag(afs, __name__, afs.__select__ & match_form_params(vid='copy'))
+copy_afs.tag_subject_of(('*', 'seda_alt_archive_unit_archive_unit_ref_id', '*'), 'main', 'hidden')