[REM] api: remove references to env.dirty
closes odoo/odoo#34556 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
@@ -448,7 +448,6 @@ class Environment(Mapping):
|
||||
self.cache = envs.cache
|
||||
self._cache_key = (cr, uid, su)
|
||||
self._protected = StackMap() # {field: ids, ...}
|
||||
self.dirty = defaultdict(set) # {record: set(field_name), ...}
|
||||
self.all = envs
|
||||
envs.add(self)
|
||||
return self
|
||||
@@ -570,7 +569,6 @@ class Environment(Mapping):
|
||||
yield
|
||||
finally:
|
||||
self.all.in_draft = False
|
||||
self.dirty.clear()
|
||||
|
||||
@property
|
||||
def in_draft(self):
|
||||
|
||||
@@ -1029,8 +1029,6 @@ class Field(MetaField('DummyField', (object,), {})):
|
||||
if inv_recs:
|
||||
for invf in record._field_inverses[self]:
|
||||
invf._update(inv_recs, record)
|
||||
# mark field as dirty
|
||||
env.dirty[record].add(self.name)
|
||||
|
||||
# determine more dependent fields, and invalidate them
|
||||
if self.relational:
|
||||
|
||||
@@ -5042,26 +5042,6 @@ Fields:
|
||||
prefetch_ids = IterableGenerator(origin_ids, self._prefetch_ids)
|
||||
return self._browse(self.env, ids, prefetch_ids)
|
||||
|
||||
#
|
||||
# Dirty flags, to mark record fields modified (in draft mode)
|
||||
#
|
||||
|
||||
def _is_dirty(self):
|
||||
""" Return whether any record in ``self`` is dirty. """
|
||||
dirty = self.env.dirty
|
||||
return any(record in dirty for record in self)
|
||||
|
||||
def _get_dirty(self):
|
||||
""" Return the list of field names for which ``self`` is dirty. """
|
||||
dirty = self.env.dirty
|
||||
return list(dirty.get(self, ()))
|
||||
|
||||
def _set_dirty(self, field_name):
|
||||
""" Mark the records in ``self`` as dirty for the given ``field_name``. """
|
||||
dirty = self.env.dirty
|
||||
for record in self:
|
||||
dirty[record].add(field_name)
|
||||
|
||||
#
|
||||
# "Dunder" methods
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user