Odoo Help


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

Paulo Matos‏
on 11/25/14, 3:17 PM 2,380 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 ?

HIGHCO - 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

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

2 follower(s)


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