inherit view error

Asked by Alberto Garcia (Factor Libre) on 2009-09-16

Y have develop a new view for products, but always get this error:

[2009-09-16 16:46:22,063] ERROR:web-services:[16]: Last revision No. & ID : Traceback (most recent call last):
[2009-09-16 16:46:22,063] ERROR:web-services:[17]: File "/home/agl00014/proyectos/openerp/expandi/src/openerp-5.0.3/openerp-server-5.0.3/bin/osv/osv.py", line 59, in wrapper
[2009-09-16 16:46:22,064] ERROR:web-services:[18]: return f(self, dbname, *args, **kwargs)
[2009-09-16 16:46:22,064] ERROR:web-services:[19]: File "/home/agl00014/proyectos/openerp/expandi/src/openerp-5.0.3/openerp-server-5.0.3/bin/osv/osv.py", line 119, in execute
[2009-09-16 16:46:22,064] ERROR:web-services:[20]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2009-09-16 16:46:22,065] ERROR:web-services:[21]: File "/home/agl00014/proyectos/openerp/expandi/src/openerp-5.0.3/openerp-server-5.0.3/bin/osv/osv.py", line 111, in execute_cr
[2009-09-16 16:46:22,065] ERROR:web-services:[22]: return getattr(object, method)(cr, uid, *args, **kw)
[2009-09-16 16:46:22,065] ERROR:web-services:[23]: File "/home/agl00014/proyectos/openerp/expandi/src/openerp-5.0.3/openerp-server-5.0.3/bin/osv/orm.py", line 1250, in fields_view_get
[2009-09-16 16:46:22,065] ERROR:web-services:[24]: xarch, xfields = self.__view_look_dom_arch(cr, user, doc, view_id, context=context)
[2009-09-16 16:46:22,066] ERROR:web-services:[25]: File "/home/agl00014/proyectos/openerp/expandi/src/openerp-5.0.3/openerp-server-5.0.3/bin/osv/orm.py", line 1055, in __view_look_dom_arch
[2009-09-16 16:46:22,066] ERROR:web-services:[26]: cr.execute('select name, model from ir_ui_view where (id=%s or inherit_id=%s) and arch like %s', (view_id, view_id, '%%%s%%' % field))
[2009-09-16 16:46:22,066] ERROR:web-services:[27]: File "/home/agl00014/proyectos/openerp/expandi/src/openerp-5.0.3/openerp-server-5.0.3/bin/sql_db.py", line 76, in wrapper
[2009-09-16 16:46:22,067] ERROR:web-services:[28]: return f(self, *args, **kwargs)
[2009-09-16 16:46:22,067] ERROR:web-services:[29]: File "/home/agl00014/proyectos/openerp/expandi/src/openerp-5.0.3/openerp-server-5.0.3/bin/sql_db.py", line 120, in execute
[2009-09-16 16:46:22,067] ERROR:web-services:[30]: res = self._obj.execute(query, params)
[2009-09-16 16:46:22,068] ERROR:web-services:[31]: ProgrammingError: el operador no existe: integer = boolean
[2009-09-16 16:46:22,068] ERROR:web-services:[32]: LINEA 1: select name, model from ir_ui_view where (id=false or inheri...
[2009-09-16 16:46:22,080] ERROR:web-services:[33]: ^
[2009-09-16 16:46:22,080] ERROR:web-services:[34]: HINT: Ningún operador coincide con el nombre y el tipo de los argumentos. Puede desear agregar conversiones explícitas de tipos.

Code of view:

<record id="product_price_normal_form_view" model="ir.ui.view">
            <field name="name">product.price.product.form</field>
            <field name="model">product.product</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="product.product_normal_form_view"/>
            <field name="arch" type="xml">
                <notebook position="inside">
                    <page string="List Prices">
                        <field name="prices_list_ids"/>
                    </page>
                </notebook>
            </field>
        </record>

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Jay Vora (Serpent Consulting Services)
Solved:
2009-09-16
Last query:
2009-09-16
Last reply:
2009-09-16

Hello Alberto,

Possible reasons:
1. _rec_name does not appear(if no field with 'name').
2. inherited_view is wrongly referenced.
3. Any other view is referenced in action (rather than form,tree,graph,calendar,gantt).

If you still have problems, send me the module.

Thanks.

Thanks Jay (Open ERP), that solved my question.

Buenas Miembros de OpenERP Spain Team, los molesto con una pregunta de la misma ìndole,

Inicie el proceso de Creación de un Nuevo Módulo, (Muy Sencillo), de Capacitación,
que muestre en el TREE: Cursos >> New Cursos. Y al Presionar Cursos muestre la View de Update

estoy teniendo el mismo error: Por favor, si ven donde le estoy errando, les agradecerìa que me indiquen.

ERROR:
---------
[2009-10-08 22:31:36,068] ERROR:web-services:[15]: res = self._obj.execute(query, params)
[2009-10-08 22:31:36,069] ERROR:web-services:[16]: ProgrammingError: operator does not exist: integer = boolean
[2009-10-08 22:31:36,070] ERROR:web-services:[17]: LINE 1: select name, model from ir_ui_view where (id=false or inheri...
[2009-10-08 22:31:36,071] ERROR:web-services:[18]: ^
[2009-10-08 22:31:36,072] ERROR:web-services:[19]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

XML:
----------------------------------------------------------------

<?xml version="1.0"?>
<openerp>
<data>

    <menuitem name="Capacitacion" id="menu_Capacitacion" />
    <menuitem
            id="menu_Cap_Curso"
            name="Cursos"
            parent="Capacitacion.menu_Capacitacion" />

    <record model="ir.ui.view" id="view_Capacitacion_form">
        <field name="name">Capacitacion.form</field>
        <field name="model">Capacitacion.Capacitacion</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Capacitacion">
    <field name="NombreCurso" />
    <field name="TypeCurso"/>
            </form>
        </field>
    </record>

    <record id="open_view_Cursos_new" model="ir.actions.act_window">
            <field name="name">New Curso</field>
            <field name="res_model">Capacitacion</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
    </record>

    <menuitem
            id="menu_open_view_Cursos_new"
            action="open_view_Cursos_new"
            parent="menu_Cap_Curso" />

</data>
</openerp>

Capacitacion.py
-----------------------------------------------
from osv import osv, fields

class Capacitacion(osv.osv):
 """Capacitacion"""
 _name = 'Capacitacion'
 _columns = {
  'NombreCurso': fields.char("NombreCurso", size=64, required=True),
  'TypeCurso': fields.char("TypeCurso", size=64, required=True),
 }
Capacitacion()

Muchas Gracias a todos
a su disposiciòn
Saludos
Ezequiel Gallardo

Hello Ezequiel,

As I posted in post no. 2, your class is missing one member '_rec_name''.

You need to define '_rec_name' because your columns have not 'name' field.

Adding this line, _rec_name = 'NombreCurso' will solve your problem.

Thanks.

Hello Jay

Thanks by your advice, with this change the module has worked properly.

Thanks
Ezequiel Gallardo

OpenErp Team Spain, muchas Gracias por su consejos tanto Alberto Garcìa como Jay para poder
seguir avanzando en el desarrollo.

Cualquier cosa que necesiten estoy a su disposición
Saludos Cordiales
Ezequiel Gallardo
Argentina

Thank you Ezequiel.