Odoo Help

0

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

By
Totor
on 3/23/16, 4:31 AM 1,639 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

Yenthe
on 3/23/16, 5:11 AM

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

Totor
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.

Register

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)

Stats

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