I'm trying to upload a file in the a custom model but I'm getting the following error:
aError:There is my code
Uncaught TypeError: Cannot read property 'clone' of undefined
http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:957
Rastreo de error:
TypeError: Cannot read property 'clone' of undefined
at Object.formatDateTime [as datetime] (http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:957:69)
at Class._renderBodyCell (http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:1575:137)
at http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:1593:132
at Function._.map._.collect (http://odoo:8069/web/content/3751-9f77f21/web.assets_common.js:13:270)
at Class._renderRow [as _super] (http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:1593:82)
at Class._renderRow (http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:1538:71)
at Class._renderRow (http://odoo:8069/web/content/3751-9f77f21/web.assets_common.js:3814:371)
at Function._.map._.collect (http://odoo:8069/web/content/3751-9f77f21/web.assets_common.js:13:270)
at Class._renderRows (http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:1594:85)
at Class._renderRows (http://odoo:8069/web/content/3752-d2319e5/web.assets_backend.js:1539:53)
class partner_document(models.Model):
_name = "partner.document"
_rec_name = "doc_type"
global function_env
function_env = 'pecuchile.partner.functions'
partner_id = fields.Many2one('res.partner', string=u"Tercero", ondelete="cascade")
doc_type = fields.Selection([(u'cover_letter', u'Carta de respaldo'),
(u'dni', u'DNI'),
(u'rut', u'RUT'),
(u'institution_document', u'RUT Tributario'),
(u'other', u'Otro') ], string=u"Tipo de documento",
required=True)
document_filename = fields.Char(string=u"Nombre de archivo")
document = fields.Binary(string=u"Archivo")description = fields.Text(string=u"Descripción")rut_serie = fields.Char(string=u"Número/Serie")
comment = fields.Text(string=u"Comentarios adicionales")
still_valid = fields.Selection([(u'valid', u'Documento Válido'),
(u'invalid', u'Documento caducado')
], default=u'valid', string=u"Validez", required=True)
additional_data = fields.Boolean(string=u"¿Información adicional?")
The model partner_document its called from another model (an extended version of res.partner) whit this declaration:
document_ids = fields.One2many('partner.document', 'partner_id', string=u"Documentos")
I've tried with different widgets and field declarations, but all ends in the same error message.
Regards