Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

ERROR: object has no attribute

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
attendanceinherithr_employeeattribute_error
1 Responder
16482 Vistas
Avatar
JeroenB

Hello,

I am trying to run this code:

models.execute_kw(DB, uid, PASS, 'hr.employee', 'attendance_action_change_jer', [state['id']], {})

I made a new class which inherits hr.employee from the hr_attendance.py
see: https://github.com/odoo/odoo/blob/8.0/addons/hr_attendance/hr_attendance.py

my new class:

class hr_employee(models.Model):

            _inherit = "hr.employee"

            # _name = "hr.employee"

            rfid_tag = fields.Char(string="RF ID tag for the user")

            def attendance_action_change_jer(self, cr, uid, ids, context=None):

                            _logger = logging.getLogger(__name__)

                            _logger.error('msg error')


but I got this error:

2015-07-10 10:30:26,989 11875 ERROR jeroen004 openerp.http: 'hr.employee' object has no attribute 'attendance_action_change_jer'

Traceback (most recent call last):

File "/home/luc/odoo/odoo/openerp/http.py", line 115, in dispatch_rpc

result = dispatch(method, params)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 37, in dispatch

res = fn(db, uid, *params)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 162, in execute_kw

return execute(db, uid, obj, method, *args, **kw or {})

File "/home/luc/odoo/odoo/openerp/service/model.py", line 113, in wrapper

return f(dbname, *args, **kwargs)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 170, in execute

res = execute_cr(cr, uid, obj, method, *args, **kw)

File "/home/luc/odoo/odoo/openerp/service/model.py", line 159, in execute_cr

return getattr(object, method)(cr, uid, *args, **kw)

AttributeError: 'hr.employee' object has no attribute 'attendance_action_change_jer'

I have no idea what goes wrong. Why isnt my new attribute recognised? Even when I copy paste 'attendance_action_change_jer' in hr_attendance.py I get the same error.
Please help me.
Thanks in advance.

0
Avatar
Descartar
Emipro Technologies Pvt. Ltd.

I think you have not given defination with new API that might be an issue. Because execute_kw is working with new model structure. So, please just give @api.multi decorator to your method. I hope it will resolve your issue.

Avatar
Bole
Mejor respuesta

Well, your class uses new api style ( models.Model) , while your method uses old style...

so, you have two possible solutions for your problem...

1. old style : you need to add on_change action in xml vew definition

2. new style : use @on_change decorator before actual method.. .

for both you can fin a lot of examples within the source code

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Can I create one cron job and perform two actions through that ?
attendance hr_employee odooV12
Avatar
Avatar
2
sept 19
7774
How to link Odoo module with attandence [odoo 12 CE]
attendance relation hr_employee
Avatar
Avatar
1
jul 19
4557
hr attendance app, customize
custom attendance inherit js v15
Avatar
0
oct 22
2563
Call a field value from hr_employee to hr_attendance?
hr employee attendance inherit odoo8.0
Avatar
0
oct 17
7953
Auto logout not working properly for all employees in odoo18ce
attendance
Avatar
Avatar
Avatar
2
oct 25
512
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now