class account_account_type(osv.osv):
_name = "account.account.type"
_description = "Account Type"
+
+ def _get_report_type(self, cr, uid, context=None):
+ report_obj = self.pool.get('account.financial.report')
+ report_ids = report_obj.search(cr, uid, [], context=context)
+ report_type = [('none','/')]
+ for report in report_obj.browse(cr, uid, report_ids, context=context):
+ type = report.account_type_ids and report.account_type_ids[0] or False
+ if type:
+ if type.code in ('income', 'expense'):
+ report_name = 'Profit & Loss ('+type.code+' accounts)'
+ elif type.code in ('asset','liability'):
+ report_name = 'Balance Sheet ('+type.code+' accounts)'
+ report_type.append((type.code, report_name))
+ return report_type
+
_columns = {
- 'name': fields.char('Account Type', size=64, required=True),
+ 'name': fields.char('Account Type', size=64, required=True, translate=True),
'code': fields.char('Code', size=32, required=True),
'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True, help="""Set here the method that will be used to generate the end of year journal entries for all the accounts of this type.