class Employee(models.Model):
_name = "hr.employee"
_description = "Employee"
_order = 'name_related'
_inherits = {'resource.resource': "resource_id"}
_inherit = ['mail.thread', 'hr.contract']
rel_field = fields.Many2one('hr.contract')
hr_wage = fields.Char(string='wage', related='rel_field.wage')class Contract(models.Model):
_name = 'hr.contract'
_description = 'Contract'
_inherit = ['mail.thread', 'ir.needaction_mixin']wage = fields.Float('Wage', digits=(16, 2), required=True, help="Basic Salary of the employee")
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
3
Replies
9867
Views
Hi,
check you have hr module as dependency in your __manifest__.py
....
'depends': [
'hr',
],
....
Best regards
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Apr 23
|
4988 | ||
|
1
May 16
|
7990 | ||
|
0
May 16
|
2252 | ||
|
1
Apr 16
|
8263 | ||
|
1
Jan 24
|
1063 |
i have added hr_contract in __init__.py file too
import hr
import mail_alias
import mail_thread
import res_partner
import res_users
import hr_contract
<field name ='hr_wage' />