[REM] core: deprecated Environment methods

Part-of: odoo/odoo#98138
This commit is contained in:
Xavier Morel
2022-10-26 19:03:46 +02:00
parent 0c56a58888
commit 6c6ca16626
-26
View File
@@ -475,22 +475,6 @@ class Environment(Mapping):
names to models. It also holds a cache for records, and a data
structure to manage recomputations.
"""
@classproperty
def envs(cls):
raise NotImplementedError(
"Since Odoo 15.0, Environment.envs no longer works; "
"use cr.transaction or env.transaction instead."
)
@classmethod
@contextmanager
def manage(cls):
warnings.warn(
"Since Odoo 15.0, Environment.manage() is useless.",
DeprecationWarning, stacklevel=2,
)
yield
def reset(self):
""" Reset the transaction, see :meth:`Transaction.reset`. """
self.transaction.reset()
@@ -701,16 +685,6 @@ class Environment(Mapping):
lazy_property.reset_all(self)
self.transaction.clear()
def clear_upon_failure(self):
""" Context manager that rolls back the environments (caches and pending
computations and updates) upon exception.
"""
warnings.warn(
"Since Odoo 15.0, use cr.savepoint() instead of env.clear_upon_failure().",
DeprecationWarning, stacklevel=2,
)
return self.cr.savepoint()
def invalidate_all(self, flush=True):
""" Invalidate the cache of all records.