summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/models.py')
-rw-r--r--odoo/models.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/odoo/models.py b/odoo/models.py
index 0ffac157bc6..e9c09e5625f 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -298,7 +298,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
"""
pass
- @api.model_cr_context
def _reflect(self):
""" Reflect the model and its fields in the models 'ir.model' and
'ir.model.fields'. Also create entries in 'ir.model.data' if the key
@@ -2281,7 +2280,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
else:
return '"%s"."%s"' % (alias, fname)
- @api.model_cr
def _parent_store_compute(self):
""" Compute parent_path field from scratch. """
if not self._parent_store:
@@ -2320,7 +2318,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
self.invalidate_cache(['parent_path'])
return True
- @api.model_cr
def _check_removed_columns(self, log=False):
# iterate on the database columns to drop the NOT NULL constraints of
# fields which were required but have been removed (or will be added by
@@ -2343,7 +2340,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
if row['attnotnull']:
tools.drop_not_null(cr, self._table, row['attname'])
- @api.model_cr_context
def _init_column(self, column_name):
""" Initialize the value of the given column for existing rows. """
# get the default value; ideally, we should use default_get(), but it
@@ -2375,7 +2371,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
self.env.cr.execute('SELECT 1 FROM "%s" LIMIT 1' % self._table)
return self.env.cr.rowcount
- @api.model_cr_context
def _auto_init(self):
""" Initialize the database schema of ``self``:
- create the corresponding table,
@@ -2446,14 +2441,12 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
if parent_path_compute:
self._parent_store_compute()
- @api.model_cr
def init(self):
""" This method is called after :meth:`~._auto_init`, and may be
overridden to create or modify a model's database schema.
"""
pass
- @api.model_cr
def _create_parent_columns(self):
tools.create_column(self._cr, self._table, 'parent_path', 'VARCHAR')
if 'parent_path' not in self._fields:
@@ -2461,7 +2454,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
elif not self._fields['parent_path'].index:
_logger.error('parent_path field on model %s must be indexed! Add index=True to the field definition)', self._name)
- @api.model_cr
def _add_sql_constraints(self):
"""
@@ -2489,7 +2481,6 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
else:
process(key, definition)
- @api.model_cr
def _execute_sql(self):
""" Execute the SQL code from the _sql attribute (if any)."""
if hasattr(self, "_sql"):
@@ -4527,7 +4518,6 @@ Fields:
"""
return cls._transient
- @api.model_cr
def _transient_clean_rows_older_than(self, seconds):
assert self._transient, "Model %s is not transient, it cannot be vacuumed!" % self._name
# Never delete rows used in last 5 minutes
@@ -4539,7 +4529,6 @@ Fields:
ids = [x[0] for x in self._cr.fetchall()]
self.sudo().browse(ids).unlink()
- @api.model_cr
def _transient_clean_old_rows(self, max_count):
# Check how many rows we have in the table
self._cr.execute("SELECT count(*) AS row_count FROM " + self._table)
@@ -4682,7 +4671,6 @@ Fields:
for record in self:
record.active = not record.active
- @api.model_cr
def _register_hook(self):
""" stuff to do right after the registry is built """
pass
@@ -4714,7 +4702,7 @@ Fields:
origin = getattr(cls, name)
method.origin = origin
# propagate decorators from origin to method, and apply api decorator
- wrapped = api.guess(api.propagate(origin, method))
+ wrapped = api.propagate(origin, method)
wrapped.origin = origin
setattr(cls, name, wrapped)