Odoo Help


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.


Odoo v8 TypeError: __init__() takes exactly 1 argument (x given)

Paulo Matos‏
on 11/25/14, 3:17 PM 1,481 views

Hi all,

I am trying to make a v7 module to work on v8.

It's almost everything ready except that I get an error when the system reads a specific class.

The error is:

File "/home/odoo/custom/addons/account_mode/__init__.py", line 29, in <module> import account_invoice

File "/home/odoo/custom/addons/account_mode/account_invoice.py", line 48, in <module> class account_payment_mode(osv.osv):

File "/home/odoo/custom/addons/account_mode/account_invoice.py", line 56, in account_payment_mode string='Money Sale Account',  method=True, view_load=True),

TypeError: __init__() takes exactly 1 argument (7 given)

The code for the class:

class account_payment_mode(osv.osv):
    _name = 'account.payment.mode'
    _description = 'Payment Mode'
    _columns = {
        'name': fields.char('Payment Mode', size=32, required=True, translate=True),
        'description': fields.text('Description'),
        'property_account_money_sale': fields.property('account.account',
            type='many2one', relation='account.account',
            string='Money Sale Account', method=True, view_load=True),

Anyone can help?

Thank you all



Did you get sorted wit this issue ?

Nicolas Clavier
on 12/17/14, 4:54 AM


| 5 3 6
Jakarta, Indonesia
On 12/17/14, 4:58 AM

In v8 you should use class account_payment_mode(orm.Model) instead of osv.osv.  The latter has been deprecated.

Thank you Ivan. Should the remmaining code still as it is? Is there any additional change to be made on the remmaing code?

ThinkOpen Solutions (Angola), Paulo Matos‏
on 12/17/14, 11:56 AM

Sorry, I missed the fact that the log pointed to the definition of property_account_money_sale column. Property field does not accept method=True attribute. Take that away.

on 12/17/14, 10:50 PM

Thank you Ivan. I will check that too and will update you soon.

ThinkOpen Solutions (Angola), Paulo Matos‏
on 12/19/14, 3:53 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

2 follower(s)


Asked: 11/25/14, 3:17 PM
Seen: 1481 times
Last updated: 3/16/15, 8:10 AM