Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
11448 Vistas
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")
Avatar
Descartar
Autor

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

Autor

<field name ='hr_wage' />

Mejor respuesta

Hi,

check you have hr module as dependency in your __manifest__.py

....
'depends': [
'hr',
],
....

Best regards 

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
abr 23
6131
1
may 16
9035
0
may 16
3196
1
abr 16
9415
1
ene 24
2216