diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py index f335c7dbd77..3f4aecb9d3f 100644 --- a/addons/hr_timesheet_invoice/__openerp__.py +++ b/addons/hr_timesheet_invoice/__openerp__.py @@ -39,6 +39,7 @@ reports, eso.""", 'hr_timesheet_invoice_report.xml', 'report/report_analytic_view.xml', 'report/hr_timesheet_invoice_report_view.xml', + 'wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml', ], 'demo_xml': ['hr_timesheet_invoice_demo.xml'], 'installable': True, diff --git a/addons/hr_timesheet_invoice/wizard/__init__.py b/addons/hr_timesheet_invoice/wizard/__init__.py index e1948e45406..b3921b01008 100644 --- a/addons/hr_timesheet_invoice/wizard/__init__.py +++ b/addons/hr_timesheet_invoice/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,14 +15,14 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## import hr_timesheet_invoice_create import account_analytic_profit import hr_timesheet_final_invoice_create -import wizard_account_analytic_cost_ledger_report +import hr_timesheet_analytic_cost_ledger_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_cost_ledger_report.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_cost_ledger_report.py new file mode 100644 index 00000000000..418aac5edd3 --- /dev/null +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_cost_ledger_report.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +import time + +from osv import osv, fields + +class hr_timesheet_analytic_cost_ledger(osv.osv_memory): + _name = 'hr.timesheet.analytic.cost.ledger' + _description = 'hr.timesheet.analytic.cost.ledger' + _columns = { + 'date1': fields.date('Start of period', required=True), + 'date2': fields.date('End of period', required=True) + } + _defaults = { + 'date1': lambda *a: time.strftime('%Y-01-01'), + 'date2': lambda *a: time.strftime('%Y-%m-%d') + } + def print_report(self, cr, uid, ids, context=None): + if context is None: + context = {} + datas = { + 'ids': 'active_ids' in context and context['active_ids'] or [], + 'model': 'account.analytic.account', + 'form': self.read(cr, uid, ids)[0] + } + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'hr.timesheet.invoice.account.analytic.account.cost_ledger', + 'datas': datas, + } + +hr_timesheet_analytic_cost_ledger() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml new file mode 100644 index 00000000000..c8f9806a309 --- /dev/null +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_analytic_cost_ledger_view.xml @@ -0,0 +1,44 @@ + + + + + + Cost Ledger + hr.timesheet.analytic.cost.ledger + form + +
+ + + + + + +