[FIX] base.sql: added a partner_id integer field on res.users, to avoid the ORM being unable to set a not null constraint on it.

bzr revid: tde@openerp.com-20120810140549-w70l7nzwn4kt1oav
This commit is contained in:
Thibault Delavallée 2012-08-10 16:05:49 +02:00
parent dffe2e8683
commit 2da4b1b3f5
2 changed files with 5 additions and 4 deletions

View File

@ -155,6 +155,7 @@ CREATE TABLE res_users (
-- No FK references below, will be added later by ORM
-- (when the destination rows exist)
company_id int,
partner_id int,
primary key(id)
);
alter table res_users add constraint res_users_login_uniq unique (login);
@ -383,7 +384,7 @@ CREATE TABLE ir_model_relation (
-- Users
---------------------------------
insert into res_users (id,login,password,name,active,company_id,lang) values (1,'admin','admin','Administrator',True,1,'en_US');
insert into res_users (id,login,password,name,active,company_id,partner_id,lang) values (1,'admin','admin','Administrator',True,1,1,'en_US');
insert into ir_model_data (name,module,model,noupdate,res_id) values ('user_root','base','res.users',True,1);
-- Compatibility purpose, to remove V6.0

View File

@ -152,13 +152,13 @@ class users(osv.osv):
# context is set.
'company_id': fields.many2one('res.company', 'Company', required=True,
help='The company this user is currently working for.', context={'user_preference': True}),
'context_company_id': fields.many2one('res.company', 'Company', required=True,
help='The company this user is currently working for.', context={'user_preference': True}),
# 'context_company_id': fields.many2one('res.company', 'Company', required=True,
# help='The company this user is currently working for.', context={'user_preference': True}),
'company_ids':fields.many2many('res.company','res_company_users_rel','user_id','cid','Companies'),
# backward compatibility fields
'user_email': fields.related('email', type='char',
deprecated='Use the email field instead of user_email. This field will be removed as of OpenERP 7.1.'),
'date': fields.related('date', type='date',
'date': fields.related('date', type='date', store=True,
deprecated='use the login_date field instead of date. This field will be removed as of OpenERP 7.1.'),
}