diff --git a/account_financial_report_horizontal/report/account_balance_sheet.py b/account_financial_report_horizontal/report/account_balance_sheet.py index 535e7cfd..50320793 100644 --- a/account_financial_report_horizontal/report/account_balance_sheet.py +++ b/account_financial_report_horizontal/report/account_balance_sheet.py @@ -43,7 +43,6 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) 'time': time, 'get_lines': self.get_lines, 'get_lines_another': self.get_lines_another, - 'get_company': self._get_company, 'get_currency': self._get_currency, 'sum_dr': self.sum_dr, 'sum_cr': self.sum_cr, @@ -58,7 +57,6 @@ class report_balancesheet_horizontal(report_sxw.rml_parse, common_report_header) 'get_journal': self._get_journal, 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, - 'get_company':self._get_company, 'get_target_move': self._get_target_move, }) self.context = context diff --git a/account_financial_report_horizontal/report/account_profit_loss.py b/account_financial_report_horizontal/report/account_profit_loss.py index 59f8ee71..792d485e 100644 --- a/account_financial_report_horizontal/report/account_profit_loss.py +++ b/account_financial_report_horizontal/report/account_profit_loss.py @@ -54,7 +54,6 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header): 'get_journal': self._get_journal, 'get_start_date':self._get_start_date, 'get_end_date':self._get_end_date, - 'get_company':self._get_company, 'get_target_move': self._get_target_move, 'get_trans':self._get_trans }) diff --git a/account_financial_report_horizontal/report/common_report_header.py b/account_financial_report_horizontal/report/common_report_header.py index 0e68f330..d2e7468c 100644 --- a/account_financial_report_horizontal/report/common_report_header.py +++ b/account_financial_report_horizontal/report/common_report_header.py @@ -24,38 +24,6 @@ from tools.translate import _ class common_report_header(object): - def _sum_debit(self, period_id=False, journal_id=False): - if journal_id and isinstance(journal_id, int): - journal_id = [journal_id] - if period_id and isinstance(period_id, int): - period_id = [period_id] - if not journal_id: - journal_id = self.journal_ids - if not period_id: - period_id = self.period_ids - if not (period_id and journal_id): - return 0.0 - self.cr.execute('SELECT SUM(debit) FROM account_move_line l ' - 'WHERE period_id IN %s AND journal_id IN %s ' + self.query_get_clause + ' ', - (tuple(period_id), tuple(journal_id))) - return self.cr.fetchone()[0] or 0.0 - - def _sum_credit(self, period_id=False, journal_id=False): - if journal_id and isinstance(journal_id, int): - journal_id = [journal_id] - if period_id and isinstance(period_id, int): - period_id = [period_id] - if not journal_id: - journal_id = self.journal_ids - if not period_id: - period_id = self.period_ids - if not (period_id and journal_id): - return 0.0 - self.cr.execute('SELECT SUM(credit) FROM account_move_line l ' - 'WHERE period_id IN %s AND journal_id IN %s '+ self.query_get_clause+'', - (tuple(period_id), tuple(journal_id))) - return self.cr.fetchone()[0] or 0.0 - def _get_start_date(self, data): if data.get('form', False) and data['form'].get('date_from', False): return data['form']['date_from'] @@ -99,35 +67,11 @@ class common_report_header(object): return _('Periods') return _('No Filter') - def _sum_debit_period(self, period_id, journal_id=None): - journals = journal_id or self.journal_ids - if not journals: - return 0.0 - self.cr.execute('SELECT SUM(debit) FROM account_move_line l ' - 'WHERE period_id=%s AND journal_id IN %s '+ self.query_get_clause +'', - (period_id, tuple(journals))) - - return self.cr.fetchone()[0] or 0.0 - - def _sum_credit_period(self, period_id, journal_id=None): - journals = journal_id or self.journal_ids - if not journals: - return 0.0 - self.cr.execute('SELECT SUM(credit) FROM account_move_line l ' - 'WHERE period_id=%s AND journal_id IN %s ' + self.query_get_clause +' ', - (period_id, tuple(journals))) - return self.cr.fetchone()[0] or 0.0 - def _get_fiscalyear(self, data): if data.get('form', False) and data['form'].get('fiscalyear_id', False): return pooler.get_pool(self.cr.dbname).get('account.fiscalyear').browse(self.cr, self.uid, data['form']['fiscalyear_id'][0]).name return '' - def _get_company(self, data): - if data.get('form', False) and data['form'].get('chart_account_id', False): - return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id'][0]).company_id.name - return '' - def _get_journal(self, data): codes = [] if data.get('form', False) and data['form'].get('journal_ids', False):