From c761404086f02cb014d7f4fcc342a27d7d78ab8c Mon Sep 17 00:00:00 2001 From: gpa Date: Wed, 3 Aug 2011 16:35:59 +0530 Subject: [PATCH] [FIX] Fixed error of non-ascii charcter in label, remove by default condition True and display group lp bug: https://launchpad.net/bugs/727263 fixed bzr revid: gpa@tinyerp.com-20110803110559-83xiqnjtb510w8ka --- openerp/addons/base/ir/ir_ui_view.py | 4 ++-- openerp/addons/base/ir/workflow/workflow.py | 24 +++++++++---------- .../addons/base/ir/workflow/workflow_view.xml | 8 +++---- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py index ee23a2f52f1..84a065fe356 100644 --- a/openerp/addons/base/ir/ir_ui_view.py +++ b/openerp/addons/base/ir/ir_ui_view.py @@ -158,10 +158,10 @@ class view(osv.osv): label_string = "" if label: for lbl in eval(label): - if t.has_key(str(lbl)) and str(t[lbl])=='False': + if t.has_key(tools.ustr(lbl)) and tools.ustr(t[lbl])=='False': label_string = label_string + ' ' else: - label_string = label_string + " " + t[lbl] + label_string = label_string + " " + tools.ustr(t[lbl]) labels[str(t['id'])] = (a['id'],label_string) g = graph(nodes, transitions, no_ancester) g.process(start) diff --git a/openerp/addons/base/ir/workflow/workflow.py b/openerp/addons/base/ir/workflow/workflow.py index c638855aacf..414420d6c81 100644 --- a/openerp/addons/base/ir/workflow/workflow.py +++ b/openerp/addons/base/ir/workflow/workflow.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -46,21 +46,21 @@ class workflow(osv.osv): return super(workflow, self).write(cr, user, ids, vals, context=context) def get_active_workitems(self, cr, uid, res, res_id, context={}): - + cr.execute('select * from wkf where osv=%s limit 1',(res,)) wkfinfo = cr.dictfetchone() workitems = [] - + if wkfinfo: cr.execute('SELECT id FROM wkf_instance \ WHERE res_id=%s AND wkf_id=%s \ ORDER BY state LIMIT 1', (res_id, wkfinfo['id'])) inst_id = cr.fetchone() - + cr.execute('select act_id,count(*) from wkf_workitem where inst_id=%s group by act_id', (inst_id,)) - workitems = dict(cr.fetchall()) - + workitems = dict(cr.fetchall()) + return {'wkf': wkfinfo, 'workitems': workitems} @@ -148,12 +148,12 @@ class wkf_transition(osv.osv): _columns = { 'trigger_model': fields.char('Trigger Object', size=128), 'trigger_expr_id': fields.char('Trigger Expression', size=128), - 'signal': fields.char('Signal (button Name)', size=64, + 'signal': fields.char('Signal (button Name)', size=64, help="When the operation of transition comes from a button pressed in the client form, "\ "signal tests the name of the pressed button. If signal is NULL, no button is necessary to validate this transition."), - 'group_id': fields.many2one('res.groups', 'Group Required', + 'group_id': fields.many2one('res.groups', 'Group Required', help="The group that a user must have to be authorized to validate this transition."), - 'condition': fields.char('Condition', required=True, size=128, + 'condition': fields.char('Condition', size=128, help="Expression to be satisfied if we want the transition done."), 'act_from': fields.many2one('workflow.activity', 'Source Activity', required=True, select=True, ondelete='cascade', help="Source activity. When this activity is over, the condition is tested to determine if we can start the ACT_TO activity."), @@ -161,9 +161,7 @@ class wkf_transition(osv.osv): help="The destination activity."), 'wkf_id': fields.related('act_from','wkf_id', type='many2one', relation='workflow', string='Workflow', select=True), } - _defaults = { - 'condition': lambda *a: 'True', - } + wkf_transition() class wkf_instance(osv.osv): diff --git a/openerp/addons/base/ir/workflow/workflow_view.xml b/openerp/addons/base/ir/workflow/workflow_view.xml index 5866b81a25e..2d6d2d1e753 100644 --- a/openerp/addons/base/ir/workflow/workflow_view.xml +++ b/openerp/addons/base/ir/workflow/workflow_view.xml @@ -52,7 +52,7 @@ - + @@ -329,7 +329,7 @@ form
- + @@ -343,7 +343,7 @@ tree - + @@ -359,7 +359,7 @@ - +