Add cabinets and metadata control codes
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -8,12 +8,14 @@ __all__ = ('ControlCodeAttributeEdit',)
|
||||
class ControlCodeAttributeEdit(ControlCode):
|
||||
arguments = ('name', 'value')
|
||||
label = 'Change document property'
|
||||
name = 'document_property_edit'
|
||||
name = 'document_property_edit_v1'
|
||||
|
||||
def execute(self, context):
|
||||
document = context['document_page'].document
|
||||
user = context.get('user', None)
|
||||
|
||||
setattr(document, self.kwargs['name'], self.kwargs['value'])
|
||||
document.save()
|
||||
document.save(_user=user)
|
||||
|
||||
|
||||
ControlCode.register(control_code=ControlCodeAttributeEdit)
|
||||
|
||||
Reference in New Issue
Block a user