~ubuntu-branches/ubuntu/oneiric/openerp-server/oneiric

« back to all changes in this revision

Viewing changes to bin/osv/fields.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2011-01-01 09:45:38 UTC
  • mfrom: (19.2.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110101094538-lg37tzn110haohp6
Tags: 5.0.15-2
* Removing README.source and headers in copyright file.
* Removing vcs fields.
* Updating year in copyright file.
* Orphaning package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
424
424
            res[id] = []
425
425
        ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id, 'in', ids)], limit=self._limit, context=context)
426
426
        for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
427
 
            res[r[self._fields_id]].append(r['id'])
 
427
            if r[self._fields_id] in res:
 
428
                res[r[self._fields_id]].append(r['id'])
428
429
        return res
429
430
 
430
431
    def set(self, cr, obj, id, field, values, user=None, context=None):
862
863
            default_val = (d and int(d.split(',')[1])) or False
863
864
 
864
865
        vids = [obj._name + ',' + str(id) for id in  ids]
865
 
        nids = property.search(cr, uid, [('fields_id', '=', definition_id),
866
 
            ('res_id', 'in', vids)])
867
 
 
 
866
        dom = [('fields_id', '=', definition_id)]
 
867
        if vids:
 
868
            dom += [('res_id', 'in', vids)]
 
869
        nids = property.search(cr, uid, dom)
868
870
        res = {}
869
871
        for id in ids:
870
872
            res[id] = default_val