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

How can i inherit "account.bank.statement.line" model?

By
samba
on 9/5/14, 6:02 AM 403 views

I am trying to inherit "account.bank.statement.line" model.  For this i am writing a below code. it's installing perfectly but fields not adding to table

.py file

*************************************************************************************************************

from openerp.osv import fields, osv

class account_bank_statement_line_extension(osv.osv):
    _inherit = 'account.bank.statement.line'
    _column={
    'payment_reference':fields.char('payment_reference',size=50),
    }
    
account_bank_statement_line_extension()

****************************************************************************

__openerp__.py

*****************************************************************************

{
'name': "Account Cashflow Extension",
'version': "1.0",
'author': "Samba",
'category': "Tools",
'description':"""
This module for to add payment_reference field to account_bank_statment_line
""",
'depends': ['account'],
'data': [

],
'demo': [],
'installable': True,
}


***********************************************************************************************

I don't have any view files. column "payment_reference" not adding to table "account_bank_statement_line".
To check weather column added or not, i am using pgadmin3. I have restarted pgadmin3 also.

 

 

0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 9/5/14, 6:10 AM

Try adding :

_name = 'account.bank.statement.line'

Because I think that is the type of inheritance you are aiming for. Also, the calling of the class is deprecated, so you can remove the final "account_bank_statement_line_extension()".

Did you include the .py file in __init__.py as well?

[EDIT]

Its columns, not column!

 

i have included .py file in __init__.py, I had write more than 10 inherited modules without _name, those are updating correctly. But i unable to find the problem in this scenario.

samba
on 9/5/14, 6:41 AM

You have column instead of columns. That should be it.

Ludo - Neobis
on 9/5/14, 8:41 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: 9/5/14, 6:02 AM
Seen: 403 times
Last updated: 3/16/15, 8:10 AM