Odoo Help


[9.0] How to solve: AttributeError: 'module' object has no attribute 'Many2one' ?

on 3/23/16, 4:31 AM 2,231 views

Hi, I have this sample code in my file procurement.py :

class procurement_order(models.Model):

_inherit = 'procurement.order'

analytic_account_id = fields.Many2one('account.analytic.account', string='Compte Analytique')

But i can't load my module on my server because there is this error :

AttributeError: 'module' object has no attribute 'Many2one'

Have you imported models at the top of your Python file? from openerp import models, fields, api

on 3/23/16, 5:11 AM

Yes, exactly with this : "from openerp import models, fields, api, _"

on 3/23/16, 5:52 AM

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

1 follower(s)


Asked: 3/23/16, 4:31 AM
Seen: 2231 times
Last updated: 3/23/16, 5:09 AM