diff options
| author | Yannick Tivisse <yti@odoo.com> | 2016-11-22 15:05:22 +0100 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2016-11-23 11:52:39 +0100 |
| commit | 98cb4719dbe90dbe980be4ad98f22fe155c2dae1 (patch) | |
| tree | f6c9a9294908207116782c6f8513f91d7aed6403 /odoo/tools | |
| parent | 94d2b97da4af28c551d246f14347f7674c4d50f5 (diff) | |
[REM] workflow: Remove workflow engine, documentation and tests
Diffstat (limited to 'odoo/tools')
| -rw-r--r-- | odoo/tools/convert.py | 20 | ||||
| -rw-r--r-- | odoo/tools/translate.py | 1 | ||||
| -rw-r--r-- | odoo/tools/yaml_import.py | 38 | ||||
| -rw-r--r-- | odoo/tools/yaml_tag.py | 14 |
4 files changed, 0 insertions, 73 deletions
diff --git a/odoo/tools/convert.py b/odoo/tools/convert.py index 0d0b14ab341..1301e035241 100644 --- a/odoo/tools/convert.py +++ b/odoo/tools/convert.py @@ -475,25 +475,6 @@ form: module.record_id""" % (xml_id,) elif res['key'] == 'action': ir_values.set_action(res['name'], action_slot=res['key2'], model=model, action=res['value'], res_id=res_id) - def _tag_workflow(self, rec, data_node=None, mode=None): - if self.isnoupdate(data_node) and self.mode != 'init': - return - model = rec.get('model').encode('ascii') - w_ref = rec.get('ref') - if w_ref: - id = self.id_get(w_ref) - else: - number_children = len(rec) - assert number_children > 0,\ - 'You must define a child node if you dont give a ref' - assert number_children == 1,\ - 'Only one child node is accepted (%d given)' % number_children - id = _eval_xml(self, rec[0], self.env) - - uid = self.get_uid(data_node, rec) - record = self.env(user=uid)[model].browse(id) - record.signal_workflow(rec.get('action').encode('ascii')) - def _tag_menuitem(self, rec, data_node=None, mode=None): rec_id = rec.get("id",'').encode('ascii') self._test_xml_id(rec_id) @@ -824,7 +805,6 @@ form: module.record_id""" % (xml_id,) 'function': self._tag_function, 'menuitem': self._tag_menuitem, 'template': self._tag_template, - 'workflow': self._tag_workflow, 'report': self._tag_report, 'ir_set': self._tag_ir_set, # deprecated:: 9.0 'act_window': self._tag_act_window, diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index ebc3dd616f7..1429480e8c0 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -726,7 +726,6 @@ def in_modules(object_name, modules): module_dict = { 'ir': 'base', 'res': 'base', - 'workflow': 'base', } module = object_name.split('.')[0] module = module_dict.get(module, module) diff --git a/odoo/tools/yaml_import.py b/odoo/tools/yaml_import.py index 93394a48f67..8e9e1342a70 100644 --- a/odoo/tools/yaml_import.py +++ b/odoo/tools/yaml_import.py @@ -64,9 +64,6 @@ def is_function(node): def is_report(node): return isinstance(node, yaml_tag.Report) -def is_workflow(node): - return isinstance(node, yaml_tag.Workflow) - def is_act_window(node): return isinstance(node, yaml_tag.ActWindow) @@ -618,36 +615,6 @@ class YamlInterpreter(object): else: self.assertion_report.record_success() - def process_workflow(self, node): - workflow, values = node.items()[0] - if self.isnoupdate(workflow) and self.mode != 'init': - return - if workflow.ref: - id = self.get_id(workflow.ref) - else: - if not values: - raise YamlImportException('You must define a child node if you do not give a ref.') - if not len(values) == 1: - raise YamlImportException('Only one child node is accepted (%d given).' % len(values)) - value = values[0] - if not 'model' in value and (not 'eval' in value or not 'search' in value): - raise YamlImportException('You must provide a "model" and an "eval" or "search" to evaluate.') - value_model = self.env[value['model']] - local_context = {'obj': value_model.browse} - local_context.update(self.id_map) - id = safe_eval(value['eval'], self.eval_context, local_context) - - if workflow.uid is not None: - uid = workflow.uid - else: - uid = self.uid - self.cr.execute('select distinct signal, sequence, id from wkf_transition ORDER BY sequence,id') - signals=[x['signal'] for x in self.cr.dictfetchall()] - if workflow.action not in signals: - raise YamlImportException('Incorrect action %s. No such action defined' % workflow.action) - record = self.env(user=uid)[workflow.model].browse(id) - record.signal_workflow(workflow.action) - def _eval_params(self, model, params): args = [] for i, param in enumerate(params): @@ -907,11 +874,6 @@ class YamlInterpreter(object): self.process_act_window(node) elif is_report(node): self.process_report(node) - elif is_workflow(node): - if isinstance(node, types.DictionaryType): - self.process_workflow(node) - else: - self.process_workflow({node: []}) elif is_function(node): if isinstance(node, types.DictionaryType): self.process_function(node) diff --git a/odoo/tools/yaml_tag.py b/odoo/tools/yaml_tag.py index 863394e317c..f921c598f30 100644 --- a/odoo/tools/yaml_tag.py +++ b/odoo/tools/yaml_tag.py @@ -47,15 +47,6 @@ class Menuitem(YamlTag): self.name = name super(Menuitem, self).__init__(**kwargs) -class Workflow(YamlTag): - def __init__(self, model, action, ref=None, **kwargs): - self.model = model - self.action = action - self.ref = ref - super(Workflow, self).__init__(**kwargs) - def __str__(self): - return '!workflow {model: %s, action: %s, ref: %s}' % (str(self.model,), str(self.action,), str(self.ref,)) - class ActWindow(YamlTag): def __init__(self, **kwargs): super(ActWindow, self).__init__(**kwargs) @@ -122,10 +113,6 @@ def menuitem_constructor(loader, node): kwargs = loader.construct_mapping(node) return Menuitem(**kwargs) -def workflow_constructor(loader, node): - kwargs = loader.construct_mapping(node) - return Workflow(**kwargs) - def act_window_constructor(loader, node): kwargs = loader.construct_mapping(node) return ActWindow(**kwargs) @@ -173,7 +160,6 @@ def add_constructors(): yaml.add_constructor(u"!record", record_constructor) yaml.add_constructor(u"!python", python_constructor) yaml.add_constructor(u"!menuitem", menuitem_constructor) - yaml.add_constructor(u"!workflow", workflow_constructor) yaml.add_constructor(u"!act_window", act_window_constructor) yaml.add_constructor(u"!function", function_constructor) yaml.add_constructor(u"!report", report_constructor) |
