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', 'name': 'Print chart of accounts',
'version': '1.0', 'version': '1.0',
'category': 'Reports/pdf', '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', 'author': 'Savoir-faire Linux',
'website': 'http://www.savoirfairelinux.com', 'website': 'http://www.savoirfairelinux.com',
'depends': [ 'depends': [
@ -48,6 +35,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,
} }

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