Merge pull request #54 from JehoG/8.0

Migration of account_chart_report to V8
pull/59/head
Pedro M. Baeza 2015-02-06 20:21:48 +01:00
commit 364f041914
12 changed files with 29 additions and 27 deletions

View File

@ -0,0 +1,17 @@
Print chart of accounts
=======================
This module add the menu Accounting \ Charts \ Print chart of Accounts
and allow to print the selected chart of accounts.
This module is based on the old RML engine report.
Credits
=======
Contributors
------------
* Marc Cassuto (marc.cassuto@savoirfairelinux.com)
* Mathieu Benoit (mathieu.benoit@savoirfairelinux.com)
* Guillaume Auger (guillaume.auger@savoirfairelinux.com)

View File

@ -25,19 +25,6 @@
'name': 'Print chart of accounts',
'version': '1.0',
'category': 'Reports/pdf',
'description': """Print chart of accounts.
This module add the menu Accounting \ Charts \ Print chart of Accounts
and allow to print the selected chart of accounts.
This module is based on the old RML engine report.
Contributors
------------
* Marc Cassuto (marc.cassuto@savoirfairelinux.com)
* Mathieu Benoit (mathieu.benoit@savoirfairelinux.com)
""",
'author': 'Savoir-faire Linux',
'website': 'http://www.savoirfairelinux.com',
'depends': [
@ -48,6 +35,6 @@ Contributors
'account_report.xml',
'wizard/account_report_chart_of_account.xml',
],
'installable': False,
'installable': True,
'auto_install': False,
}

View File

@ -20,25 +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'
_description = 'Chart of accounts Report'
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),
}
chart_account_id = fields.Many2one(
'account.account',
'Chart of Accounts',
help='Select Charts of Accounts',
required=True,
domain=([('parent_id', '=', False)]))
def print_report(self, cr, uid, ids, data, context=None):
res = self.read(cr, uid, ids, context=context)[0]
account_id = res["chart_account_id"][0]
@api.multi
def print_report(self, data):
account_id = self.chart_account_id.id
data["form"] = {"id_account": account_id}
return {
'type': 'ir.actions.report.xml',