Refactor the ModelAttribute class into two separate classes: ModelAttribute for executable model attributes and ModelField for actual ORM fields. Expose more document fields for use in smart links.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-09-17 02:43:04 -04:00
parent fafdb538b3
commit 03c54395cc
11 changed files with 196 additions and 77 deletions
+6 -5
View File
@@ -90,18 +90,19 @@ class DocumentStatesApp(MayanAppConfig):
WorkflowAction.initialize()
ModelAttribute(
Document, 'workflow.< workflow internal name >.get_current_state',
model=Document,
name='workflow.< workflow internal name >.get_current_state',
label=_('Current state of a workflow'), description=_(
'Return the current state of the selected workflow'
), type_name=['property', 'indexing']
)
)
ModelAttribute(
Document,
'workflow.< workflow internal name >.get_current_state.completion',
model=Document,
name='workflow.< workflow internal name >.get_current_state.completion',
label=_('Current state of a workflow'), description=_(
'Return the completion value of the current state of the '
'selected workflow'
), type_name=['property', 'indexing']
)
)
ModelPermission.register(