From 921c10e56ee02a69662f2016d5aa4f7e444945d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 22 Oct 2008 20:04:46 +0200 Subject: [PATCH 1/5] Print exception on delete error --- trytond/tools/convert.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trytond/tools/convert.py b/trytond/tools/convert.py index 6465de63e1..940f936221 100644 --- a/trytond/tools/convert.py +++ b/trytond/tools/convert.py @@ -854,8 +854,9 @@ def post_import(cursor, pool, module, to_delete): 'There should be some relation ' \ 'that points to this resource\n' \ 'You should manually fix this ' \ - 'and restart --update=module' % \ - (db_id, model)) + 'and restart --update=module\n' \ + 'Exception: %s' % \ + (db_id, model, str(exception))) transition_obj = pool.get('workflow.transition') for mdata_id, db_id in transition_delete: From 06f2ec37519fd566fb499e1eddb29c3a99a61ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 22 Oct 2008 20:05:10 +0200 Subject: [PATCH 2/5] Set ondelete_target CASCADE for groups on ir.ui.view --- trytond/ir/ui/menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/ir/ui/menu.py b/trytond/ir/ui/menu.py index 2c9b7d9a19..78fcb74f6a 100644 --- a/trytond/ir/ui/menu.py +++ b/trytond/ir/ui/menu.py @@ -81,7 +81,7 @@ class UIMenu(OSV): childs = fields.One2Many('ir.ui.menu', 'parent','Childs') parent = fields.Many2One('ir.ui.menu', 'Parent Menu', select=1) groups = fields.Many2Many('res.group', 'ir_ui_menu_group_rel', - 'menu_id', 'gid', 'Groups') + 'menu_id', 'gid', 'Groups', ondelete_target='CASCADE') complete_name = fields.Function('get_full_name', string='Complete Name', type='char', order_field='name') icon = fields.Selection(ICONS, 'Icon') From 0be63c0c3cc61f9203531e09285893f6e9f6af09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 Oct 2008 10:54:28 +0200 Subject: [PATCH 3/5] Add states on activity --- trytond/workflow/workflow.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/trytond/workflow/workflow.py b/trytond/workflow/workflow.py index cade0cb344..ef6adc3c2b 100644 --- a/trytond/workflow/workflow.py +++ b/trytond/workflow/workflow.py @@ -66,10 +66,16 @@ class WorkflowActivity(OSV): ('subflow', 'Subflow'), ('stopall', 'Stop All'), ], 'Kind', required=True) - action = fields.Char('Action') + action = fields.Text('Action', states={ + 'readonly': "kind == 'dummy'", + 'required': "kind == 'function'", + }) flow_start = fields.Boolean('Flow Start') flow_stop = fields.Boolean('Flow Stop') - subflow = fields.Many2One('workflow', 'Subflow') + subflow = fields.Many2One('workflow', 'Subflow', states={ + 'readonly': "kind != 'subflow'", + 'required': "kind == 'subflow'", + }) signal_send = fields.Char('Signal (subflow.*)') out_transitions = fields.One2Many('workflow.transition', 'act_from', 'Outgoing transitions') From 2782d870c310dd4a469b67d16b4671859bc508a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 Oct 2008 10:54:41 +0200 Subject: [PATCH 4/5] Fix typo --- trytond/wkf_service/workitem.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trytond/wkf_service/workitem.py b/trytond/wkf_service/workitem.py index 3408320a5d..7cbee6291b 100644 --- a/trytond/wkf_service/workitem.py +++ b/trytond/wkf_service/workitem.py @@ -100,17 +100,17 @@ def _execute(cursor, workitem, activity, ident): str(type(id_new)) cursor.execute('SELECT id FROM wkf_instance ' \ 'WHERE res_id = %s AND workflow = %s', - (id_new, activity['subflow_id'])) + (id_new, activity['subflow'])) (id_new,) = cursor.fetchone() else: - id_new = instance.create(cursor, ident, activity['subflow_id']) + id_new = instance.create(cursor, ident, activity['subflow']) cursor.execute('UPDATE wkf_workitem ' \ 'SET subflow = %s WHERE id = %s', (id_new, workitem['id'])) - workitem['subflow_id'] = id_new + workitem['subflow'] = id_new if workitem['state'] == 'running': cursor.execute("SELECT state FROM wkf_instance " \ - "WHERE id = %s", (workitem['subflow_id'],)) + "WHERE id = %s", (workitem['subflow'],)) (state,) = cursor.fetchone() if state == 'complete': _state_set(cursor, workitem, 'complete') From 6d5fcdde4a3c56f32dde2bd11e78f720f69a1ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 23 Oct 2008 16:48:23 +0200 Subject: [PATCH 5/5] Add extras_require --- setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup.py b/setup.py index 215d054913..0b804f1fc4 100644 --- a/setup.py +++ b/setup.py @@ -47,4 +47,11 @@ setup(name=PACKAGE, 'egenix-mx-base', 'relatorio >= 0.2.0', ], + extras_require={ + 'WebDAV': ['PyWebDAV'], + 'PDF': ['openoffice.interact'], + 'SSL': ['pyOpenSSL'], + 'graphviz': ['pydot'], + 'timezone': ['pytz'], + }, )