'Determine the value of ``self`` for ``record``.'

def determine_value(self, record):

    env = record.env
    if (self.store and (not (self.compute and env.in_onchange))):
        if self.compute:
            recs = record._recompute_check(self)
            if recs:
                self.compute_value(recs)
                if (recs.env != env):
                    computed = record._field_computed[self]
                    for (source, target) in zip(recs, recs.with_env(env)):
                        try:
                            values = target._convert_to_cache({f.name: source[f.name] for f in computed}, validate=False)
                        except MissingError as e:
                            values = FailedValue(e)
                        target._cache.update(values)
                return
        record._prefetch_field(self)
    elif self.compute:
        if self.recursive:
            self.compute_value(record)
        else:
            recs = record._in_cache_without(self)
            recs = recs.with_prefetch(record._prefetch)
            self.compute_value(recs)
    else:
        record._cache[self] = self.convert_to_cache(False, record, validate=False)
