Browse Source

Port account_chart_report to V8: Changing api for V8

pull/54/head
Guillaume Auger 10 years ago
parent
commit
ebaa30e3f4
  1. 2
      account_chart_report/__openerp__.py
  2. 21
      account_chart_report/wizard/account_report_chart_of_account.py

2
account_chart_report/__openerp__.py

@ -48,6 +48,6 @@ Contributors
'account_report.xml', 'account_report.xml',
'wizard/account_report_chart_of_account.xml', 'wizard/account_report_chart_of_account.xml',
], ],
'installable': False,
'installable': True,
'auto_install': False, 'auto_install': False,
} }

21
account_chart_report/wizard/account_report_chart_of_account.py

@ -20,24 +20,23 @@
# #
############################################################################## ##############################################################################
from openerp.osv import fields, orm
from openerp import fields, models, api
class ChartOfAccountsReport(orm.TransientModel):
class ChartOfAccountsReport(models.TransientModel):
_name = 'account.print.chart.accounts.report' _name = 'account.print.chart.accounts.report'
_description = 'Chart of accounts Report' _description = 'Chart of accounts Report'
domain_char_account = [('parent_id', '=', False)] domain_char_account = [('parent_id', '=', False)]
_columns = {
'chart_account_id': fields.many2one('account.account',
'Chart of Accounts',
help='Select Charts of Accounts',
required=True,
domain=domain_char_account),
}
def print_report(self, cr, uid, ids, data, context=None):
res = self.read(cr, uid, ids, context=context)[0]
chart_account_id = fields.Many2one('account.account',
'Chart of Accounts',
help='Select Charts of Accounts',
required=True,
domain=domain_char_account)
@api.multi
def print_report(self, data):
res = self.read()[0]
account_id = res["chart_account_id"][0] account_id = res["chart_account_id"][0]
data["form"] = {"id_account": account_id} data["form"] = {"id_account": account_id}
return { return {

Loading…
Cancel
Save