I am writing a module in OpenERP that would inherit from the Accounts module. Below is my simplified code
from osv import fields, osv
import decimal_precision as dp
class account_molly(osv.osv):
def __computeOB(self, cr, uid, ids, context=None):
res = []
return 0
def __computeCB(self, cr, uid, ids, context=None):
res = []
return 0
_name = "account.molly"
_description = "This is Molly Special Account View"
_inherit = "account.account"
_columns = {
'opening_balance': fields.function(__computeOB, digits_compute=dp.get_precision('Account'), method=True, string='Opening Balance'),
'end_balance': fields.function(__computeCB, digits_compute=dp.get_precision('Account'), method=True, string='End Balance'),
}
account_molly()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
When I try to install the module, I get
AttributeError: 'NoneType' object has no attribute '_columns'
Please what could be the problem
Please check the dependency of the module you have created. In the openerp.py file, in the dependency list if ‘account’ is not added, please add it. If this didnt solve your problem please provide the error log