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

I want to add few fields to hr_employee and new tables in the database related to employee.

Employee create form is not reflected with the new fields even though added in the database.

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

If you want to add a field to hr.employee, then you have 2 choices:

  1. Add a field in menu "Settings -> Technical -> Database Structure -> Models". Therefore your user must have the access right Technical Features. Afterwards you have to add the new field in the desired views. The easiest way to do this is to activate the Developer mode (see here), go to the view you want to change and e.g. choose Edit TreeView in the drop-down box.
  2. Create a new Module (see OpenERP Developer documentation)

You should never insert a new field directly in the database!

Update: I found the following question related to this one here

Ảnh đại diện
Huỷ bỏ

This answer might also provide a useful guide.

Câu trả lời hay nhất

Need also add field to XML view definition.

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

Hi, 

You can watch following video to know how to add a custom field in Odoo:

https://youtu.be/A-0uQnJr3QA

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

Hi,
Once you add a field, you have to add it corresponding model and if you need to display it in the user interface, it has to be added to the corresponding view also.

* inherit and add field to the model, which will add a field in the db table
* inherit the view and place the field

See: How To Inherit And Add Field In Odoo

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
4678
4
thg 10 20
6626
1
thg 8 25
3517
3
thg 5 25
1661
1
thg 4 25
1251