summaryrefslogtreecommitdiff
path: root/odoo/addons/base/data/base_data.sql
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-05-05 13:58:21 +0000
committerXavier Morel <xmo@odoo.com>2020-05-27 06:16:01 +0000
commit148f3dabc91fbb59ae5abe6396ca614a708577b9 (patch)
tree44f22b9eccd6fddf4ae4e9bb17aa6ff74f8731bb /odoo/addons/base/data/base_data.sql
parent2a0638079e1940a950255058d782f42e132aab17 (diff)
[IMP] base: make ir.model.data use access fields
Apparently some "core objects" used to have a pair of fields (date_init, date_update) which predate the current access fields (hopefully anyway, the genesis of both is lost to time so we can only speculate). odoo/odoo#34988 removed them on constrains & relations and left them on ir.model.data, but they do seem redundant with the regular access fields which *are* enabled on ir.model.data. * removes the date_init/date_update fields * converts the one bit of code which did set those to set create_date/write_date * add a default value on the columns, to ensure create_date is properly set even from SQL queries * use create_date/write_date in the view * adds setting those columns to a bunch of raw SQL queries which were missing them (also updates the queries some to merge the literal values into the queries as it seems unnecessary to interpolate e.g. a boolean literal) Builds on and closes odoo/odoo#50516 as that's why I started looking into it, and that fix is in this branch as well. closes odoo/odoo#50661 Related: odoo/upgrade#1213 Related: odoo/enterprise#10772 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'odoo/addons/base/data/base_data.sql')
-rw-r--r--odoo/addons/base/data/base_data.sql6
1 files changed, 2 insertions, 4 deletions
diff --git a/odoo/addons/base/data/base_data.sql b/odoo/addons/base/data/base_data.sql
index 7219f0c786f..837c5635a7c 100644
--- a/odoo/addons/base/data/base_data.sql
+++ b/odoo/addons/base/data/base_data.sql
@@ -84,13 +84,11 @@ CREATE TABLE ir_module_module_dependency (
CREATE TABLE ir_model_data (
id serial NOT NULL,
create_uid integer,
- create_date timestamp without time zone,
- write_date timestamp without time zone,
+ create_date timestamp without time zone DEFAULT (now() at time zone 'UTC'),
+ write_date timestamp without time zone DEFAULT (now() at time zone 'UTC'),
write_uid integer,
noupdate boolean DEFAULT False,
name varchar NOT NULL,
- date_init timestamp without time zone,
- date_update timestamp without time zone,
module varchar NOT NULL,
model varchar NOT NULL,
res_id integer,