Enable smart links from the documents types side

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-29 01:08:52 -04:00
parent aee3645c7a
commit cfe623e093
8 changed files with 93 additions and 21 deletions

View File

@@ -19,12 +19,13 @@ from mayan.apps.navigation.classes import SourceColumn
from .events import event_smart_link_created, event_smart_link_edited
from .links import (
link_smart_link_create, link_smart_link_condition_create,
link_smart_link_condition_delete, link_smart_link_condition_edit,
link_smart_link_condition_list, link_smart_link_delete,
link_smart_link_document_types, link_smart_link_edit,
link_smart_link_instance_view, link_smart_link_instances_for_document,
link_smart_link_list, link_smart_link_setup
link_document_type_smart_links, link_smart_link_create,
link_smart_link_condition_create, link_smart_link_condition_delete,
link_smart_link_condition_edit, link_smart_link_condition_list,
link_smart_link_delete, link_smart_link_document_types,
link_smart_link_edit, link_smart_link_instance_view,
link_smart_link_instances_for_document, link_smart_link_list,
link_smart_link_setup
)
from .permissions import (
permission_smart_link_delete, permission_smart_link_edit,
@@ -47,6 +48,9 @@ class LinkingApp(MayanAppConfig):
Document = apps.get_model(
app_label='documents', model_name='Document'
)
DocumentType = apps.get_model(
app_label='documents', model_name='DocumentType'
)
ResolvedSmartLink = self.get_model(model_name='ResolvedSmartLink')
SmartLink = self.get_model(model_name='SmartLink')
@@ -106,6 +110,9 @@ class LinkingApp(MayanAppConfig):
link_smart_link_condition_list,
), sources=(SmartLink,)
)
menu_list_facet.bind_links(
links=(link_document_type_smart_links,), sources=(DocumentType,)
)
menu_object.bind_links(
links=(
link_smart_link_condition_edit,