简体   繁体   中英

how to set a simple field in openerp custom module

Hi I am trying to create a simple filed in my custom openerp 7 module. I am using win 7 and eclipse IDE. But the problem is when I am creating my .py file as my code is as follows

" from openerp.osv import fields,osv

import time

class formview(osv.osv):

    _columns = {'name': fields.char('name',size=64) }

formview() "

I am receiving an error

" _columns = {'name': fields.char('name',size=64) }

       ^

IndentationError: expected an indented block "

What am I missing I dont know . Plz guide me as I am new to openerp and python.

Hopes for suggestion

Its very simple and most common issue for new developers.

You have to configure your IDE with 4 space instead of tab. Once you configure it will not show this error.

If you using ubuntu then use gedit much batter and easy for openerp developement.

To right now resolve your issue, use four space instead of one tab.

OpenERP follow indentation by four space.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM