Remove workflow
review299001
This commit is contained in:
1 parent
94a8a64ba7
commit
e605a355d0
4 files changed
+5
-45
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Remove workflow
|
||||
* Improve contextual menu:
|
||||
- Actions for all relation fields on list view
|
||||
- Use icons
|
||||
|
||||
@@ -171,16 +171,9 @@ class ViewForm(ParserView):
|
||||
if record_id:
|
||||
if not attrs.get('confirm', False) or \
|
||||
common.sur(attrs['confirm']):
|
||||
button_type = attrs.get('type', 'workflow')
|
||||
button_type = attrs.get('type', 'object')
|
||||
context = record.context_get()
|
||||
if button_type == 'workflow':
|
||||
try:
|
||||
RPCExecute('model', self.screen.model_name,
|
||||
'workflow_trigger_validate', record_id,
|
||||
attrs['name'], context=context)
|
||||
except RPCException:
|
||||
pass
|
||||
elif button_type == 'object':
|
||||
if button_type == 'object':
|
||||
try:
|
||||
RPCExecute('model', self.screen.model_name, attrs['name'],
|
||||
[record_id], context=context)
|
||||
|
||||
@@ -992,16 +992,9 @@ class Button(object):
|
||||
if obj_id:
|
||||
if not self.attrs.get('confirm', False) or \
|
||||
common.sur(self.attrs['confirm']):
|
||||
button_type = self.attrs.get('type', 'workflow')
|
||||
button_type = self.attrs.get('type', 'object')
|
||||
ctx = record.context_get()
|
||||
if button_type == 'workflow':
|
||||
try:
|
||||
RPCExecute('model', self.screen.model_name,
|
||||
'workflow_trigger_validate', obj_id,
|
||||
self.attrs['name'], context=ctx)
|
||||
except RPCException:
|
||||
pass
|
||||
elif button_type == 'object':
|
||||
if button_type == 'object':
|
||||
try:
|
||||
RPCExecute('model', self.screen.model_name,
|
||||
self.attrs['name'], [obj_id], context=ctx)
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
#this repository contains the full copyright notices and license terms.
|
||||
from tryton.action import Action
|
||||
import gettext
|
||||
|
||||
_ = gettext.gettext
|
||||
|
||||
|
||||
def workflow_print(datas):
|
||||
datas = datas.copy()
|
||||
datas['nested'] = False
|
||||
Action.exec_report('workflow.instance.graph', datas)
|
||||
return True
|
||||
|
||||
|
||||
def workflow_print_complex(datas):
|
||||
datas = datas.copy()
|
||||
datas['nested'] = True
|
||||
Action.exec_report('workflow.instance.graph', datas)
|
||||
return True
|
||||
|
||||
|
||||
def get_plugins(model):
|
||||
return [
|
||||
(_('Print Workflow'), workflow_print),
|
||||
(_('Print Workflow (Complex)'), workflow_print_complex),
|
||||
]
|
||||
Reference in new issue
Block a user