Odoo Help


Error In Python file

on 11/29/13, 1:54 PM 2,222 views

in create python code in my modulue here is code

    from osv import osv , fields
     class asset_allocation(osv.osv):
   _name = 'asset.allocation'
   _description = 'Asset Allocation'
   _columns = {
    'asset_id': fields.many2one('account.asset.asset', 'Asset', required=True),
    'employee_id': fields.many2one('hr.employee', 'Employee', required=True),
    'asset_status': fields.date.time( 'Status', required=True,),
    'note': fields.text('Note'),



Unresolved import: fields

Undefined variable from import: osv

in Openerp 7 you can't directly import osv for that you need to follow this from openerp.osv import osv, fields

Anil R. Kesariya
on 12/1/13, 4:19 AM

Mariusz Mizgier

--Mariusz Mizgier--
| 4 1 7
SOPOT, Poland
--Mariusz Mizgier--

OpenERP developer

Mariusz Mizgier
On 11/29/13, 3:36 PM

You've used bad syntax. Correct way is:

from openerp.osv import fields, osv

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 11/29/13, 1:54 PM
Seen: 2222 times
Last updated: 3/16/15, 8:10 AM