~openerp/openobject-server/5.0

« back to all changes in this revision

Viewing changes to bin/osv/orm.py

  • Committer: Stephane Wirtel
  • Date: 2010-12-20 12:03:32 UTC
  • Revision ID: stephane@openerp.com-20101220120332-k23l2jnzjqzn9s5m
[FIX] Avoid to update a field if this one is not stored

Show diffs side-by-side

added added

removed removed

Lines of Context:
2235
2235
                if v is None:
2236
2236
                    r[key] = False
2237
2237
                if key in self._columns.keys():
2238
 
                    type = self._columns[key]._type
 
2238
                    field = self._columns[key]
2239
2239
                elif key in self._inherit_fields.keys():
2240
 
                    type = self._inherit_fields[key][2]._type
 
2240
                    field = self._inherit_fields[key][2]
2241
2241
                else:
2242
2242
                    continue
2243
 
                if type == 'reference' and v:
 
2243
                if field._type == 'reference' and getattr(field, 'store', True) and v:
2244
2244
                    model,ref_id = v.split(',')
2245
2245
                    table = self.pool.get(model)._table
2246
2246
                    cr.execute('select id from "%s" where id=%%s' % (table,), (ref_id,))