Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
411 Vistas

I have an error with the following code, but I don't know why

 class bvIrAttachment(models.Model):       

 _inherit = ['mail.thread' ,'ir.attachment']    


Error:

/

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: The _name attribute bvIrAttachment is not valid
Avatar
Descartar
Autor

Thanks very much

Mejor respuesta

Hi, 

You need to add _name as below:

class bvIrAttachment(models.Model):   
inherit = ['mail.thread' ,'ir.attachment']
_name = 'ir.attachment'

Avatar
Descartar