Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7900 Lượt xem

I wanna use the official hr module, But I wanna use my own fields. So I need to change the type of many fields.

eg. In the hr.employee, I wanna change the field:address_home_id from type "many2one" to "char". How can I do it ?

I know two ways:

First: settings->custom->model->edit.. It seems that I change it correctly, But it is not changed in the view.

Second: go to the source of the module;change the code:

'address_home_id': fields.many2one('res.partner.address', 'Home Address'),

to

'address_home_id': fields.char('Home Address',size=32),

But when I create a new record, failed!

Can somebody tell me how to get it right?

Thank you in advance!

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello,

In relational field you have to create new database. In other case like char -> integer, integer -> char you can restart the server and get newly assigned datatype.

Thank you.

Ảnh đại diện
Huỷ bỏ
Tác giả

Thanks, what do you mean by creating a new database?

In login(Home) page you can view 'manage databases' link. From that you can create new database.

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 16
5754
2
thg 6 19
3204
1
thg 3 15
5732
1
thg 2 25
1507
1
thg 11 24
2844