diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index 10ecea48d77..1fe6bd355bd 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -55,7 +55,8 @@ module named account_voucherss 'wizard/account_move_journal_view.xml', 'account_wizard.xml', 'wizard/account_move_line_unreconcile_select_view.xml', - + 'wizard/account_subscription_generate_view.xml', + 'project/wizard/project_account_analytic_line_view.xml', 'account_view.xml', 'account_end_fy.xml', 'account_invoice_view.xml', diff --git a/addons/account/account_wizard.xml b/addons/account/account_wizard.xml index b17df5b4edb..1597ec8898e 100644 --- a/addons/account/account_wizard.xml +++ b/addons/account/account_wizard.xml @@ -86,8 +86,10 @@ --> + diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index e53047b8718..e0854f8d65d 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -204,10 +204,14 @@ form - + - + + Analytic Entries diff --git a/addons/account/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py index 21a811ebe5f..f11fa936960 100644 --- a/addons/account/project/wizard/__init__.py +++ b/addons/account/project/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -15,7 +15,7 @@ # 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 . # ############################################################################## @@ -25,7 +25,7 @@ import wizard_account_analytic_inverted_balance_report import wizard_account_analytic_cost_ledger_report import wizard_account_analytic_cost_ledger_for_journal_report import wizard_account_analytic_analytic_check -import wizard_account_analytic_line +import project_account_analytic_line import wizard_analytic_account_chart # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/project_account_analytic_line.py b/addons/account/project/wizard/project_account_analytic_line.py new file mode 100644 index 00000000000..a7fbe0a8254 --- /dev/null +++ b/addons/account/project/wizard/project_account_analytic_line.py @@ -0,0 +1,58 @@ +# -*- 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 . +# +############################################################################## + +from osv import fields, osv +from tools.translate import _ + +class project_account_analytic_line(osv.osv_memory): + _name = "project.account.analytic.line" + _description = "Analytic Entries by line" + _columns = { + 'from_date': fields.date('From'), + 'to_date': fields.date('To'), + } + + def action_open_window(self, cr, uid, ids, context={}): + mod_obj =self.pool.get('ir.model.data') + domain = [] + for data in self.read(cr, uid, ids,context=context): + from_date =data['from_date'] + to_date =data['to_date'] + if from_date and to_date: + domain = [('date','>=',from_date), ('date','<=',to_date)] + elif from_date: + domain = [('date','>=',from_date)] + elif to_date: + domain = [('date','<=',to_date)] + result = mod_obj._get_id(cr, uid, 'account', 'view_account_analytic_line_filter') + id = mod_obj.read(cr, uid, result, ['res_id'], context=context) + return { + 'name': _('Analytic Entries by line'), + 'view_type': 'form', + "view_mode": 'tree,form', + 'res_model': 'account.analytic.line', + 'type': 'ir.actions.act_window', + 'domain': domain, + 'search_view_id': id['res_id'],} + +project_account_analytic_line() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/project/wizard/project_account_analytic_line_view.xml b/addons/account/project/wizard/project_account_analytic_line_view.xml new file mode 100644 index 00000000000..30cc9998cb5 --- /dev/null +++ b/addons/account/project/wizard/project_account_analytic_line_view.xml @@ -0,0 +1,36 @@ + + + + + + project.account.analytic.line.form + project.account.analytic.line + form + +
+ + + + + +