~openerp-dev/openobject-server/trunk-improve-configuration-warnings-tpa

« back to all changes in this revision

Viewing changes to openerp/addons/base/workflow/workflow.py

  • Committer: Sunil Sharma
  • Date: 2014-05-09 11:18:54 UTC
  • mfrom: (5214.1.2 trunk)
  • Revision ID: ssh@tinyerp.com-20140509111854-rz9rujk3g0oqien6
[mrg]:lp:openobject-server

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
    _defaults = {
124
124
        'condition': lambda *a: 'True',
125
125
    }
 
126
 
 
127
    def name_get(self, cr, uid, ids, context=None):
 
128
        return [(line.id, (line.act_from.name) + '+' + (line.act_to.name)) if line.signal == False else (line.id, line.signal) for line in self.browse(cr, uid, ids, context=context)]
 
129
 
 
130
    def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
 
131
        if args is None:
 
132
            args = []
 
133
        if name:
 
134
            ids = self.search(cr, user, ['|',('act_from', operator, name),('act_to', operator, name)] + args, limit=limit)
 
135
            return self.name_get(cr, user, ids, context=context)
 
136
        return super(wkf_transition, self).name_search(cr, user, name, args=args, operator=operator, context=context, limit=limit)
 
137
 
 
138
 
126
139
wkf_transition()
127
140
 
128
141
class wkf_instance(osv.osv):