Skip to Content
Menu
This question has been flagged
1 Reply
1700 Views

Good evening, I am making a relationship between two models, but I get an error message that I cannot identify, what could it be? thanks,

Odoo Server Error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 651, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 693, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 937, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 934, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 926, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 687, in call_kw
    return call_kw_model(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 672, in call_kw_model
    result = method(recs, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3394, in create
    record = self.browse(self._create(old_vals))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3487, in _create
    cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "report_comprobantes_efact_wizard_comprobantes_detalle_formato_i" does not exist
LINE 1: ...uid", "create_date", "write_date") VALUES(nextval('report_co...



class WizardInvoiceLineReport(models.TransientModel):

    _name = 'report_comprobantes_efact.wizard.comprobantes.detalle.formato'

    fecha_inicio = fields.Date("Fecha de Inicio")

    fecha_fin = fields.Date("Fecha Fin")

    company_currency_id = fields.Many2one('res.currency')

    company_id = fields.Many2one('res.company', string='Company', readonly=True, default=lambda self: self.env.user.company_id)

    linea=fields.One2many('report_comprobantes_efact.wizard.comprobantes.detalle','linea_id')


    def imprimir(self):

        return True


class WizardInvoiceDetalleReport(models.TransientModel):

    _name = 'report_comprobantes_efact.wizard.comprobantes.detalle'

    linea_id=fields.Many2one('report_comprobantes_efact.wizard.comprobantes.detalle.formato')

    number=fields.Char("Numero")

    product_id=fields.Integer("Id Producto")

    price_total=fields.Float("Precio Total Linea")

Avatar
Discard
Best Answer

Hi,

Upon checking the code seems to fine, so just make sure that the both the files have been imported in the init file and also service is restarted after adding the new models.


See: How to Add One2many Fields In Odoo


Thanks

Avatar
Discard