[PATCH 3 of 3 seda] [views/clone] On copying an archive unit, hide its underlying alternative

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Mar 7 18:51:34 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1488908911 -3600
#      Tue Mar 07 18:48:31 2017 +0100
# Node ID 4998a81545d5b846cd9829104803228909eb4209
# Parent  34b3b1ec652174a21da490a6972d8cb3aabedf42
[views/clone] On copying an archive unit, hide its underlying alternative

using yet another custom afs.

diff --git a/cubicweb_seda/views/archiveunit.py b/cubicweb_seda/views/archiveunit.py
--- a/cubicweb_seda/views/archiveunit.py
+++ b/cubicweb_seda/views/archiveunit.py
@@ -20,11 +20,11 @@ from six import text_type
 from logilab.mtconverter import xml_escape
 from logilab.common.registry import objectify_predicate
 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
 
 from cubicweb_compound import views as compound
 from cubes.relationwidget import views as rwdg
@@ -1102,5 +1102,9 @@ class DataObjectReferenceNoTitleEntityIn
     """
 
     __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')


More information about the saem-devel mailing list