Is there a module to separate last name and first name for employees? There's one for partners but I can't locate one for employees.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
class hr_employee(osv.osv):
_name = "hr.employee"
_description = "Employee"
_inherits = {'resource.resource': "resource_id"}
"""
_inherit = 'resource.resource'
_columns = {
'firstname' : fields.char(first name', size=64),
'lastname' : fields.char(last name', size=128, required=True),
}
and in xml file you add the two fields
We have already name Field inside hr.employee so just add one field for Last name In hr.py file :
class hr_employee(osv.osv):
_inherit = 'hr.employee'
_columns = {
'employee_last_name' : fields.char("Last Name", size = 64),
}
hr_employee()
In xml add this field
<record id="th_hr_inherite_form" model="ir.ui.view">
<field name="name">hr.employee.form</field>
<field name="model">hr.employee</field>
<field name="priority" eval="1"/>
<field name="type">form</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<label for="name" class="oe_edit_only" position="replace"/>
<field name="name" position="replace"/>
<field name="image_medium" position="after">
<group col='4' colspan='2'>
<field name="name" string= "First Name"/>
<field name="employee_last_name" placeholder=""/>
<newline/>
</group>
</field>
</field>
</record>
remember that each employee also has a partner record so you may be able to use that and avoid having to add to the employee
You can add a new field 'Surname' if you are the admin account user. Make sure you have enabled 'Technical Settings' for your user account. After you enable it, you can see a new sub menu item 'Technical' in Setting page. Goto Settings/Technical/Database Structure/Fields. Add the field in respective model(hr). Once done adding the field, in the form view of employee, enable debug mode, and add 'Surname' field in the 'edit form view'. You can apply this approach to add as many fields to models in OpenERP. Reply to this if still have any questions.
In ODOO V11 CE, the Technical sub-menu does not show even after I Activate Developer Mode (with assets). Is there something I'm missing?
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 7 17
|
3937 | ||
|
1
thg 11 15
|
4245 | ||
|
1
thg 7 24
|
1657 | ||
|
1
thg 1 24
|
4600 | ||
|
2
thg 3 23
|
2489 |