~ajite/server-env-tools/7.0-server-env-tools-0001

« back to all changes in this revision

Viewing changes to mail_environment/env_mail.py

  • Committer: Holger Brunn
  • Date: 2013-07-04 20:01:18 UTC
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: hbrunn@therp.nl-20130704200118-3ee49mfn2t29rh4c
[ADD] dbfilter_from_header

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
            res[fetchmail.id] = config_vals
129
129
        return res
130
130
 
131
 
    def _type_search(self, cr, uid, obj, name, args, context={}):
132
 
        result_ids = []
133
 
        # read all incomming servers values
134
 
        all_ids = self.search(cr, uid, [], context=context)
135
 
        results = self.read(cr, uid, all_ids, ['id','type'], context=context)
136
 
        args = args[:]
137
 
        i = 0
138
 
        while i < len(args):
139
 
            operator = args[i][1]
140
 
            if operator == '=':
141
 
                for res in results:
142
 
                    if (res['type'] == args[i][2]) and (res['id'] not in result_ids):
143
 
                        result_ids.append(res['id'])
144
 
            elif operator == 'in':
145
 
                for search_vals in args[i][2]:
146
 
                    for res in results:
147
 
                        if (res['type'] == search_vals) and (res['id'] not in result_ids):
148
 
                           result_ids.append(res['id'])                
149
 
            else:
150
 
                continue
151
 
            i += 1
152
 
        return [('id', 'in', result_ids)]
153
 
 
154
131
    _columns = {
155
132
        'server': fields.function(_get_incom_conf,
156
133
                                  method=True,
169
146
                                string='Type',
170
147
                                type="char",
171
148
                                multi='income_mail_config',
172
 
                                fnct_search=_type_search,
173
149
                                size=64,
174
150
                                help="pop, imap, local"),
175
151
        'is_ssl': fields.function(_get_incom_conf,