[PATCH saem_ref] [seda] Hide seda_transferring_agency_archive_unit_identifier from archiveunit form

Denis Laxalde denis.laxalde at logilab.fr
Thu Mar 22 15:16:41 CET 2018


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1521728169 -3600
#      Thu Mar 22 15:16:09 2018 +0100
# Node ID 3d15f53fa243fa224503231e5405cc2433470b10
# Parent  17c7ae2c58dcd2bc3fe70581280c88e9fcb52418
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r 3d15f53fa243
[seda] Hide seda_transferring_agency_archive_unit_identifier from archiveunit form

Followup on 1493be198e6e, which I thought was enough but is apparently
not working for the edition form. The trick here is that we cannot rely
on a plain "autoform_section" uicfg rule because SAEM is using the
simplified version of SEDA profiles for which there is a dedicated
(derived) uicfg rtag in cubicweb_seda/views/simplified.py. So we add a
new tag to hide this seda_transferring_agency_archive_unit_identifier
relation using this "simplified_afs" relation tag object.

CONSEJIRA-445

diff --git a/cubicweb_saem_ref/views/seda.py b/cubicweb_saem_ref/views/seda.py
--- a/cubicweb_saem_ref/views/seda.py
+++ b/cubicweb_saem_ref/views/seda.py
@@ -22,6 +22,7 @@ from cubicweb_seda.views import (
     archivetransfer,
     archiveunit,
     rtags_from_rtype_role_targets,
+    simplified
 )
 
 
@@ -56,6 +57,12 @@ class SimplifiedContentMainView(archiveu
     rsection, display_ctrl = rtags_from_rtype_role_targets(CONTENT_ETYPE, rtype_role_targets)
 
 
+simplified.simplified_afs.tag_object_of(
+    ('*', 'seda_transferring_agency_archive_unit_identifier', CONTENT_ETYPE),
+    'main', 'hidden',
+)
+
+
 def registration_callback(vreg):
     vreg.register_all(globals().values(), __name__, [SimplifiedContentMainView])
     vreg.register_and_replace(SimplifiedContentMainView, archiveunit.SimplifiedContentMainView)



More information about the saem-devel mailing list