Community mailing list archives

community@mail.odoo.com

Re: ProgrammingError: relation "_unknown" does not exist - Odoo v9 c

by
kristian
- 10/06/2016 21:50:23
LoL,I'm sorry, just a typo on comodel, it has to be: comodel_name

Thank You

On Thu, Oct 6, 2016 at 8:13 PM, Kristian Koci <kristian.koci@gmail.com> wrote:
Hi

I'm having trouble this time with another view

I already added 'sale' on the 'depend' section of my module.

I'm inheriting sale.order object from this module, on my models.py:

# -*- coding: utf-8 -*-

from openerp import models, fields, api

class estados(models.Model):
    _name = 'estados'
    _rec_name = "estado"

    estado = fields.Char(string="Estado de la orden de venta",)
    numero = fields.Integer(string="Numero del estado",)
    descripcion = fields.Text()

class sale_order(models.Model):
    _name = 'sale.order'
    _inherit = 'sale.order'

    estado_del_pedido = fields.Many2one(comodel="estados.venta", string="Estado del pedido")

On my view:

        <record model="ir.ui.view" id="estado_form_view">
            <field name="name">sale.order.estados.form</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form" />
            <field name="arch" type="xml">
                <field name='partner_id' position="after">
                    <field name="estado_del_pedido"/>
                </field>
            </field>
        </record>

Every time I try to select a record from sale.order it throws me this:

2016-10-07 00:08:58,656 24146 WARNING danisansolti_1 openerp.models: Cannot execute name_search, no _rec_name defined on _unknown
2016-10-07 00:08:58,681 24146 INFO danisansolti_1 openerp.sql_db: Programming error: relation "_unknown" does not exist
LINE 1: SELECT "_unknown".id FROM "_unknown" ORDER BY "_unknown"."id...
                                  ^
, in query SELECT "_unknown".id FROM "_unknown" ORDER BY "_unknown"."id"   limit 8


I already did something like this on another module, and it worked, cant figure out what's wrong this time

Thanks in advance!

--
Kristian Koci
Linux User #582221



--
Kristian Koci
Linux User #582221