Commit 000ccaa0 authored by Yann Voté's avatar Yann Voté
Browse files

[ui] Display archive unit referencing a data object

Instead of displaying the DataObjectReference entity. And put this information
in the `relations` section.
parent e2f684129bf5
......@@ -4586,6 +4586,9 @@ msgctxt "SEDAPreventInheritance"
msgid "prevent_inheritance"
msgstr ""
msgid "referenced by:"
msgstr ""
msgid "restriction_rule_id_ref"
msgstr ""
......
......@@ -4594,6 +4594,9 @@ msgctxt "SEDAPreventInheritance"
msgid "prevent_inheritance"
msgstr ""
msgid "referenced by:"
msgstr "référencé par :"
msgid "restriction_rule_id_ref"
msgstr ""
......
......@@ -32,6 +32,7 @@ from cubes.seda.views import viewlib
_ = unicode
pvs = uicfg.primaryview_section
pv_ctrl = uicfg.primaryview_display_ctrl
rec = uicfg.reledit_ctrl
afs = uicfg.autoform_section
affk = uicfg.autoform_field_kwargs
......@@ -74,6 +75,13 @@ class ContainedSearchForRelatedEntitiesView(rwdg.SearchForRelatedEntitiesView):
# hide some relation from autoform because of limitation of _container_eid
afs.tag_object_of(('*', 'seda_compressed', 'SEDABinaryDataObject'), 'main', 'hidden')
pvs.tag_object_of(('*', 'seda_compressed', 'SEDABinaryDataObject'), 'attributes')
pvs.tag_object_of(('*', 'seda_data_object_reference_id', 'SEDABinaryDataObject'),
'relations')
pv_ctrl.tag_object_of(('*', 'seda_data_object_reference_id', 'SEDABinaryDataObject'),
{'vid': 'autolimited',
'subvid': 'seda.object-ref.archive-unit',
'label': _('referenced by:'),
})
rec.tag_object_of(('*', 'seda_compressed', 'SEDABinaryDataObject'),
{'rvid': 'seda.reledit.complexlink',
'novalue_label': _('<unauthorized>')})
......@@ -228,6 +236,17 @@ class RelationshipReverseEntityView(view.EntityView):
self.w(xml_escape(msg))
class ObjectReferencepArchiveUnitEntityView(view.EntityView):
__regid__ = 'seda.object-ref.archive-unit'
__select__ = is_instance('SEDADataObjectReference')
def entity_call(self, entity):
au_seq = entity.seda_data_object_reference[0]
au_choice = au_seq.reverse_seda_seq_alt_archive_unit_archive_unit_ref_id_management[0]
archive_unit = au_choice.reverse_seda_alt_archive_unit_archive_unit_ref_id[0]
self._cw.view('listitem', rset=archive_unit.as_rset(), w=self.w)
class AttachmentBusinessValueEntityView(viewlib.BusinessValueEntityView):
__select__ = is_instance('SEDAAttachment')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment