Odoo Help

Welcome!

This community 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.

0

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

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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