~openerp-dev/openobject-server/trunk-forward-port-mat

« back to all changes in this revision

Viewing changes to openerp/tools/convert.py

  • Committer: Martin Trigaux
  • Date: 2014-05-12 08:05:23 UTC
  • mfrom: (5189.1.22 saas-4)
  • Revision ID: mat@openerp.com-20140512080523-t1ugjl53jfgohfde
Forward-port of latest saas-4, up to revision 5211 (revid fme@openerp.com-20140509164408-rtml4brrhpiv4zz9)

Show diffs side-by-side

added added

removed removed

Lines of Context:
305
305
 
306
306
        if d_search:
307
307
            idref = _get_idref(self, cr, self.uid, d_model, context={}, idref={})
308
 
            ids = self.pool[d_model].search(cr, self.uid, unsafe_eval(d_search, idref))
 
308
            try:
 
309
                ids = self.pool[d_model].search(cr, self.uid, unsafe_eval(d_search, idref))
 
310
            except ValueError:
 
311
                _logger.warning('Skipping deletion for failed search `%r`', d_search, exc_info=True)
 
312
                pass
309
313
        if d_id:
310
314
            try:
311
315
                ids.append(self.id_get(cr, d_id))
312
 
            except:
 
316
            except ValueError:
313
317
                # d_id cannot be found. doesn't matter in this case
 
318
                _logger.warning('Skipping deletion for missing XML ID `%r`', d_id, exc_info=True)
314
319
                pass
315
320
        if ids:
316
321
            self.pool[d_model].unlink(cr, self.uid, ids)