commit
364f041914
|
@ -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)
|
|
@ -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,
|
||||||
}
|
}
|
|
@ -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=domain_char_account),
|
domain=([('parent_id', '=', False)]))
|
||||||
}
|
|
||||||
|
|
||||||
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',
|
Loading…
Reference in New Issue