diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index da1f95de301..c432689de44 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -95,7 +95,6 @@ module named account_voucher. 'account_invoice_workflow.xml', 'project/project_view.xml', 'project/project_report.xml', - 'project/wizard/account_analytic_check_view.xml', 'project/wizard/account_analytic_balance_report_view.xml', 'project/wizard/account_analytic_cost_ledger_view.xml', 'project/wizard/account_analytic_inverted_balance_report.xml', diff --git a/addons/account/project/project_report.xml b/addons/account/project/project_report.xml index 0bc8077761e..39bf22430d9 100644 --- a/addons/account/project/project_report.xml +++ b/addons/account/project/project_report.xml @@ -11,7 +11,6 @@ - diff --git a/addons/account/project/report/analytic_check.py b/addons/account/project/report/analytic_check.py deleted file mode 100644 index a35f2ec718c..00000000000 --- a/addons/account/project/report/analytic_check.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- 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 - -import pooler -from report import report_sxw - -class account_analytic_analytic_check(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(account_analytic_analytic_check, self).__init__(cr, uid, name, context=context) - self.sum_gen_deb = 0.0 - self.sum_gen_cred = 0.0 - self.sum_ana_deb = 0.0 - self.sum_ana_cred = 0.0 - self.localcontext.update( { - 'time': time, - 'lines_p': self._lines_p, - 'general_debit': self._gen_deb, - 'general_credit': self._gen_cred, - 'analytic_debit': self._ana_deb, - 'analytic_credit': self._ana_cred, - 'delta_debit': self._delta_deb, - 'delta_credit': self._delta_cred, - }) - def _lines_p(self, date1, date2): - res = [] - acc_obj = self.pool.get('account.account') - - for a in acc_obj.read(self.cr, self.uid, self.ids, ['name', 'code']): - self.cr.execute("SELECT sum(debit), sum(credit) \ - FROM account_move_line \ - WHERE date>=%s AND date<=%s AND state<>'draft' AND account_id = %s", (date1, date2, a['id'])) - (gd, gc) = self.cr.fetchone() - gd = gd or 0.0 - gc = gc or 0.0 - - self.cr.execute("SELECT abs(sum(amount)) AS balance \ - FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount<0 AND general_account_id = %s", (date1, date2, a['id'])) - (ad,) = self.cr.fetchone() - ad = ad or 0.0 - self.cr.execute("SELECT abs(sum(amount)) AS balance \ - FROM account_analytic_line \ - WHERE date>=%s AND date<=%s AND amount>0 AND general_account_id = %s", (date1, date2, a['id'])) - (ac,) = self.cr.fetchone() - ac = ac or 0.0 - - res.append({'code': a['code'], 'name': a['name'], - 'gen_debit': gd, - 'gen_credit': gc, - 'ana_debit': ad, - 'ana_credit': ac, - 'delta_debit': gd - ad, - 'delta_credit': gc - ac,}) - self.sum_gen_deb += gd - self.sum_gen_cred += gc - self.sum_ana_deb += ad - self.sum_ana_cred += ac - - return res - - def _gen_deb(self, date1, date2): - return self.sum_gen_deb - - def _gen_cred(self, date1, date2): - return self.sum_gen_cred - - def _ana_deb(self, date1, date2): - return self.sum_ana_deb - - def _ana_cred(self, date1, date2): - return self.sum_ana_cred - - def _delta_deb(self, date1, date2): - return (self._gen_deb(date1,date2)-self._ana_deb(date1,date2)) - - def _delta_cred(self, date1, date2): - return (self._gen_cred(date1,date2)-self._ana_cred(date1,date2)) - -report_sxw.report_sxw('report.account.analytic.account.analytic.check', 'account.analytic.account', 'addons/account/project/report/analytic_check.rml',parser=account_analytic_analytic_check, header="internal") - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/report/analytic_check.rml b/addons/account/project/report/analytic_check.rml deleted file mode 100644 index 501cf1204eb..00000000000 --- a/addons/account/project/report/analytic_check.rml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - Account Name - - - General Debit - - - General Credit - - - Analytic Debit - - - Analytic Credit - - - Delta Debit - - - Delta Credit - - - - - [[ (lines_p(data['form']['date1'],data['form']['date2']),'acc') == False or removeParentNode('para') ]] - Total - - - - [[ formatLang( general_debit(data['form']['date1'],data['form']['date2'])) ]] - - - [[ formatLang( general_credit(data['form']['date1'],data['form']['date2'])) ]] - - - [[ formatLang( analytic_debit(data['form']['date1'],data['form']['date2'])) ]] - - - [[ formatLang( analytic_credit(data['form']['date1'],data['form']['date2'])) ]] - - - [[ formatLang( delta_debit(data['form']['date1'],data['form']['date2'])) ]] - - - [[ formatLang( delta_credit(data['form']['date1'],data['form']['date2'])) ]] - - - - - [[ repeatIn(lines_p(data['form']['date1'],data['form']['date2']),'acc') ]] [[ acc['code'] ]] - - - [[ acc['name'] ]] - - - [[ formatLang( acc['gen_debit']) ]] - - - [[ formatLang( acc['gen_credit']) ]] - - - [[ formatLang( acc['ana_debit']) ]] - - - [[ formatLang( acc['ana_credit']) ]] - - - [[ formatLang( acc['delta_debit']) ]] - - - [[ formatLang( acc['delta_credit']) ]] - - - - - \ No newline at end of file diff --git a/addons/account/project/wizard/__init__.py b/addons/account/project/wizard/__init__.py index 60f591fcb55..f47281672a8 100644 --- a/addons/account/project/wizard/__init__.py +++ b/addons/account/project/wizard/__init__.py @@ -24,7 +24,6 @@ import account_analytic_balance_report import account_analytic_inverted_balance_report import account_analytic_cost_ledger_report import account_analytic_cost_ledger_for_journal_report -import account_analytic_check import project_account_analytic_line import account_analytic_chart diff --git a/addons/account/project/wizard/account_analytic_check.py b/addons/account/project/wizard/account_analytic_check.py deleted file mode 100644 index 53327963151..00000000000 --- a/addons/account/project/wizard/account_analytic_check.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- 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 account_analytic_check(osv.osv_memory): - _name = 'account.analytic.check' - _description = 'Account Analytic Check' - - _columns = { - 'date1': fields.date('Start of period', required=True), - 'date2': fields.date('End of period', required=True), - } - - _defaults = { - 'date1':time.strftime('%Y-01-01'), - 'date2':time.strftime('%Y-%m-%d') - } - - def check_report(self, cr, uid, ids, context=None): - datas = {} - if context is None: - context = {} - data = self.read(cr, uid, ids)[0] - datas = { - 'ids': context.get('active_ids',[]), - 'model': 'account.account', - 'form': data - } - return { - 'type': 'ir.actions.report.xml', - 'report_name': 'account.analytic.account.analytic.check', - 'datas': datas, - } - -account_analytic_check() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/project/wizard/account_analytic_check_view.xml b/addons/account/project/wizard/account_analytic_check_view.xml deleted file mode 100644 index d12acd214a4..00000000000 --- a/addons/account/project/wizard/account_analytic_check_view.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Account Analytic Check - account.analytic.check - form - -
- - - - - - -