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

i am learning module creation but stuck at a point. can some buddy help me out. odoo is saying syntax error at line 8. mean on title field

#this is teting learning module

# coding: utf-8

from openerp import models,fields, osv

class book(models.Model):

_name="book.book"

_description="simple book"

_coloumn={

title = fields.Char(string='Title', required=True)

desc = fields.text("Description"),

author = fields.char(string="Author", size=30, required=True)

}

Avatar
Descartar
Mejor respuesta

Hello Ahmed,


_coloumn spell is wrong.

Try this :-

Old api :-

from openerp import models,fields, osv

class book(models.Model):

    _name="book.book"

    _description="simple book"

    _columns = {

        'title' : fields.char(string='Title', required=True),

        'desc': fields.text("Description"),

        'author': fields.char(string="Author", size=30, required=True),

    }


New Api :-

from openerp import models,fields, osv

class book(models.Model):

    _name="book.book"

    _description="simple book" 

       

    title =  fields.Char(string='Title', required=True)

    desc = fields.Text("Description")

    author =  fields.Char(string="Author", size=30, required=True)

 

Hope this useful to you.

Thanks,

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
5
abr 19
5707
1
mar 15
8523
new module? Resuelto
10
may 20
4473
6
jul 18
11571
3
abr 17
10077