summaryrefslogtreecommitdiff
path: root/addons/base_sparse_field/__init__.py
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2017-01-19 16:29:29 +0100
committerGitHub <noreply@github.com>2017-01-19 16:29:29 +0100
commitb0646f9d2c983481f20bea31f8f6427bbfccb245 (patch)
treef3e22dd4dc6ab5c09331af50e30c71616fcd0048 /addons/base_sparse_field/__init__.py
parentcb90aeade61c8b19ee0313a948ef2fbbf44b2380 (diff)
[REF] move support for sparse fields into a separate module (#15070)
This removal has led to a necessary refactoring: - make the setup of field attributes extensible; - make the instantiation of custom fields extensible; - delegate model and field reflection to `ir.model` and `ir.model.fields`; - move the implementation of sparse and serialized fields to module `base_sparse_field`;
Diffstat (limited to 'addons/base_sparse_field/__init__.py')
-rw-r--r--addons/base_sparse_field/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/base_sparse_field/__init__.py b/addons/base_sparse_field/__init__.py
new file mode 100644
index 00000000000..edbaa61c052
--- /dev/null
+++ b/addons/base_sparse_field/__init__.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+
+from . import models
+from . import tests
+
+def _update_database_schema(cr):
+ # The reflection of fields is done before updating the model's schema,
+ # therefore we first update the schema.
+ cr.execute("""
+ ALTER TABLE ir_model_fields
+ ADD COLUMN serialization_field_id integer REFERENCES ir_model_fields ON DELETE cascade
+ """)