Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to change the type of a field in a model(a table) of the official module (hr) OpenERP

By
duan yuanping
on 7/25/13, 10:30 PM 937 views

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!

0

Hiral Patel (hip)

--Hiral Patel (hip)--
Tiny ERP Pvt Ltd
http://www.odoo.com
913
| 2 1 5
India
--Hiral Patel (hip)--


Hiral Patel (hip)
On 7/26/13, 3:47 AM

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.

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

duan yuanping
on 7/26/13, 5:55 AM

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

Hiral Patel (hip)
on 7/26/13, 8:00 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/25/13, 10:30 PM
Seen: 937 times
Last updated: 3/16/15, 8:10 AM