From e51b4f659fc5e4253d3156754ada21166c8d1bf8 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 25 Sep 2018 01:24:43 +0200 Subject: [PATCH] [REM] account: Remove deprecated pdf reports --- addons/account/__manifest__.py | 17 +- addons/account/report/__init__.py | 9 +- addons/account/report/account_balance.py | 82 --------- .../report/account_financial_report.py | 65 ------- .../account/report/account_general_ledger.py | 139 --------------- .../account/report/account_overdue_report.py | 70 -------- .../account/report/account_partner_ledger.py | 123 ------------- .../report/account_report_financial.py | 164 ------------------ addons/account/report/account_tax.py | 72 -------- addons/account/security/ir.model.access.csv | 2 - addons/account/views/account_menuitem.xml | 4 +- addons/account/views/account_report.xml | 56 ------ addons/account/views/account_view.xml | 71 -------- addons/account/views/report_financial.xml | 110 ------------ addons/account/views/report_generalledger.xml | 107 ------------ addons/account/views/report_overdue.xml | 88 ---------- addons/account/views/report_partnerledger.xml | 93 ---------- .../report_payment_receipt_templates.xml} | 0 addons/account/views/report_tax.xml | 39 ----- addons/account/views/report_trialbalance.xml | 68 -------- addons/account/wizard/__init__.py | 8 - .../wizard/account_financial_report.py | 51 ------ .../wizard/account_financial_report_view.xml | 76 -------- .../account_report_aged_partner_balance.py | 41 ----- ...count_report_aged_partner_balance_view.xml | 44 ----- .../wizard/account_report_common_account.py | 18 -- .../wizard/account_report_common_partner.py | 18 -- .../wizard/account_report_general_ledger.py | 23 --- .../account_report_general_ledger_view.xml | 40 ----- .../wizard/account_report_partner_ledger.py | 18 -- .../account_report_partner_ledger_view.xml | 41 ----- .../account_report_print_journal_view.xml | 37 ---- addons/account/wizard/account_report_tax.py | 12 -- .../wizard/account_report_tax_view.xml | 35 ---- .../wizard/account_report_trial_balance.py | 16 -- .../account_report_trial_balance_view.xml | 38 ---- 36 files changed, 3 insertions(+), 1892 deletions(-) delete mode 100644 addons/account/report/account_balance.py delete mode 100644 addons/account/report/account_financial_report.py delete mode 100644 addons/account/report/account_general_ledger.py delete mode 100644 addons/account/report/account_overdue_report.py delete mode 100644 addons/account/report/account_partner_ledger.py delete mode 100644 addons/account/report/account_report_financial.py delete mode 100644 addons/account/report/account_tax.py delete mode 100644 addons/account/views/report_financial.xml delete mode 100644 addons/account/views/report_generalledger.xml delete mode 100644 addons/account/views/report_overdue.xml delete mode 100644 addons/account/views/report_partnerledger.xml rename addons/account/{report/account_report_payment_receipt_templates.xml => views/report_payment_receipt_templates.xml} (100%) delete mode 100644 addons/account/views/report_tax.xml delete mode 100644 addons/account/views/report_trialbalance.xml delete mode 100644 addons/account/wizard/account_financial_report.py delete mode 100644 addons/account/wizard/account_financial_report_view.xml delete mode 100644 addons/account/wizard/account_report_aged_partner_balance.py delete mode 100644 addons/account/wizard/account_report_aged_partner_balance_view.xml delete mode 100644 addons/account/wizard/account_report_common_account.py delete mode 100644 addons/account/wizard/account_report_common_partner.py delete mode 100644 addons/account/wizard/account_report_general_ledger.py delete mode 100644 addons/account/wizard/account_report_general_ledger_view.xml delete mode 100644 addons/account/wizard/account_report_partner_ledger.py delete mode 100644 addons/account/wizard/account_report_partner_ledger_view.xml delete mode 100644 addons/account/wizard/account_report_print_journal_view.xml delete mode 100644 addons/account/wizard/account_report_tax.py delete mode 100644 addons/account/wizard/account_report_tax_view.xml delete mode 100644 addons/account/wizard/account_report_trial_balance.py delete mode 100644 addons/account/wizard/account_report_trial_balance_view.xml diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index d7b935dde04..8336c8c7dd5 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -42,34 +42,19 @@ You could use this simplified accounting in case you work with an (external) acc 'views/account.xml', 'views/report_invoice.xml', 'report/account_invoice_report_view.xml', - 'views/report_overdue.xml', 'views/account_cash_rounding_view.xml', 'wizard/account_report_common_view.xml', - 'wizard/account_report_print_journal_view.xml', 'views/report_journal.xml', - 'wizard/account_report_partner_ledger_view.xml', - 'views/report_partnerledger.xml', - 'wizard/account_report_general_ledger_view.xml', - 'views/report_generalledger.xml', - 'wizard/account_report_trial_balance_view.xml', - 'views/report_trialbalance.xml', - 'views/account_financial_report_data.xml', - 'wizard/account_financial_report_view.xml', - 'views/report_financial.xml', - 'wizard/account_report_aged_partner_balance_view.xml', - 'views/report_agedpartnerbalance.xml', 'views/tax_adjustments.xml', 'wizard/wizard_tax_adjustments_view.xml', 'views/res_config_settings_views.xml', 'views/account_invoice_import_wizard_view.xml', 'views/account_journal_dashboard_view.xml', 'views/account_portal_templates.xml', - 'report/account_report_payment_receipt_templates.xml', + 'views/report_payment_receipt_templates.xml', 'data/payment_receipt_data.xml', 'wizard/setup_wizards_view.xml', 'views/account_onboarding_templates.xml', - 'wizard/account_report_tax_view.xml', - 'views/report_tax.xml', 'data/service_cron_reverse.xml', 'views/account_fiscal_year_view.xml', 'views/account_incoterms_view.xml', diff --git a/addons/account/report/__init__.py b/addons/account/report/__init__.py index e31bd861513..0082db0381a 100644 --- a/addons/account/report/__init__.py +++ b/addons/account/report/__init__.py @@ -1,13 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from . import account_financial_report from . import account_invoice_report -from . import account_overdue_report -from . import account_general_ledger -from . import account_balance -from . import account_report_financial -from . import account_aged_partner_balance -from . import account_partner_ledger from . import account_journal -from . import account_tax +from . import account_aged_partner_balance diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py deleted file mode 100644 index 13b7a03e188..00000000000 --- a/addons/account/report/account_balance.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- - -import time -from odoo import api, models, _ -from odoo.exceptions import UserError - - -class ReportTrialBalance(models.AbstractModel): - _name = 'report.account.report_trialbalance' - _description = 'Trial Balance Report' - - def _get_accounts(self, accounts, display_account): - """ compute the balance, debit and credit for the provided accounts - :Arguments: - `accounts`: list of accounts record, - `display_account`: it's used to display either all accounts or those accounts which balance is > 0 - :Returns a list of dictionary of Accounts with following key and value - `name`: Account name, - `code`: Account code, - `credit`: total amount of credit, - `debit`: total amount of debit, - `balance`: total amount of balance, - """ - - account_result = {} - # Prepare sql query base on selected parameters from wizard - tables, where_clause, where_params = self.env['account.move.line']._query_get() - tables = tables.replace('"','') - if not tables: - tables = 'account_move_line' - wheres = [""] - if where_clause.strip(): - wheres.append(where_clause.strip()) - filters = " AND ".join(wheres) - # compute the balance, debit and credit for the provided accounts - request = ("SELECT account_id AS id, SUM(debit) AS debit, SUM(credit) AS credit, (SUM(debit) - SUM(credit)) AS balance" +\ - " FROM " + tables + " WHERE account_id IN %s " + filters + " GROUP BY account_id") - params = (tuple(accounts.ids),) + tuple(where_params) - self.env.cr.execute(request, params) - for row in self.env.cr.dictfetchall(): - account_result[row.pop('id')] = row - - account_res = [] - for account in accounts: - res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance']) - currency = account.currency_id and account.currency_id or account.company_id.currency_id - res['code'] = account.code - res['name'] = account.name - if account.id in account_result: - res['debit'] = account_result[account.id].get('debit') - res['credit'] = account_result[account.id].get('credit') - res['balance'] = account_result[account.id].get('balance') - if display_account == 'all': - account_res.append(res) - if display_account == 'not_zero' and not currency.is_zero(res['balance']): - account_res.append(res) - if display_account == 'movement' and (not currency.is_zero(res['debit']) or not currency.is_zero(res['credit'])): - account_res.append(res) - return account_res - - - @api.model - def _get_report_values(self, docids, data=None): - if not data.get('form') or not self.env.context.get('active_model'): - raise UserError(_("Form content is missing, this report cannot be printed.")) - - self.model = self.env.context.get('active_model') - docs = self.env[self.model].browse(self.env.context.get('active_ids', [])) - display_account = data['form'].get('display_account') - accounts = docs if self.model == 'account.account' else self.env['account.account'].search([]) - account_res = self.with_context(data['form'].get('used_context'))._get_accounts(accounts, display_account) - - return { - 'doc_ids': self.ids, - 'doc_model': self.model, - 'data': data['form'], - 'docs': docs, - 'time': time, - 'Accounts': account_res, - 'company_id': self.env['res.company'].browse( - data['form']['company_id'][0]), - } diff --git a/addons/account/report/account_financial_report.py b/addons/account/report/account_financial_report.py deleted file mode 100644 index 0dd860b1d18..00000000000 --- a/addons/account/report/account_financial_report.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import api, models, fields - -# --------------------------------------------------------- -# Account Financial Report -# --------------------------------------------------------- - - -class account_financial_report(models.Model): - _name = "account.financial.report" - _description = "Account Report" - - @api.multi - @api.depends('parent_id', 'parent_id.level') - def _get_level(self): - '''Returns a dictionary with key=the ID of a record and value = the level of this - record in the tree structure.''' - for report in self: - level = 0 - if report.parent_id: - level = report.parent_id.level + 1 - report.level = level - - def _get_children_by_order(self): - '''returns a recordset of all the children computed recursively, and sorted by sequence. Ready for the printing''' - res = self - children = self.search([('parent_id', 'in', self.ids)], order='sequence ASC') - if children: - for child in children: - res += child._get_children_by_order() - return res - - name = fields.Char('Report Name', required=True, translate=True) - parent_id = fields.Many2one('account.financial.report', 'Parent') - children_ids = fields.One2many('account.financial.report', 'parent_id', 'Account Report') - sequence = fields.Integer('Sequence') - level = fields.Integer(compute='_get_level', string='Level', store=True) - type = fields.Selection([ - ('sum', 'View'), - ('accounts', 'Accounts'), - ('account_type', 'Account Type'), - ('account_report', 'Report Value'), - ], 'Type', default='sum') - account_ids = fields.Many2many('account.account', 'account_account_financial_report', 'report_line_id', 'account_id', 'Accounts') - account_report_id = fields.Many2one('account.financial.report', 'Report Value') - account_type_ids = fields.Many2many('account.account.type', 'account_account_financial_report_type', 'report_id', 'account_type_id', 'Account Types') - sign = fields.Selection([(-1, 'Reverse balance sign'), (1, 'Preserve balance sign')], 'Sign on Reports', required=True, default=1, - help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.') - display_detail = fields.Selection([ - ('no_detail', 'No detail'), - ('detail_flat', 'Display children flat'), - ('detail_with_hierarchy', 'Display children with hierarchy') - ], 'Display details', default='detail_flat') - style_overwrite = fields.Selection([ - (0, 'Automatic formatting'), - (1, 'Main Title 1 (bold, underlined)'), - (2, 'Title 2 (bold)'), - (3, 'Title 3 (bold, smaller)'), - (4, 'Normal Text'), - (5, 'Italic Text (smaller)'), - (6, 'Smallest Text'), - ], 'Financial Report Style', default=0, - help="You can set up here the format you want this record to be displayed. If you leave the automatic formatting, it will be computed based on the financial reports hierarchy (auto-computed field 'level').") diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py deleted file mode 100644 index caf72143533..00000000000 --- a/addons/account/report/account_general_ledger.py +++ /dev/null @@ -1,139 +0,0 @@ -# -*- coding: utf-8 -*- - -import time -from odoo import api, models, _ -from odoo.exceptions import UserError - - -class ReportGeneralLedger(models.AbstractModel): - _name = 'report.account.report_generalledger' - _description = 'General Ledger Report' - - def _get_account_move_entry(self, accounts, init_balance, sortby, display_account): - """ - :param: - accounts: the recordset of accounts - init_balance: boolean value of initial_balance - sortby: sorting by date or partner and journal - display_account: type of account(receivable, payable and both) - - Returns a dictionary of accounts with following key and value { - 'code': account code, - 'name': account name, - 'debit': sum of total debit amount, - 'credit': sum of total credit amount, - 'balance': total balance, - 'amount_currency': sum of amount_currency, - 'move_lines': list of move line - } - """ - cr = self.env.cr - MoveLine = self.env['account.move.line'] - move_lines = {x: [] for x in accounts.ids} - - # Prepare initial sql query and Get the initial move lines - if init_balance: - init_tables, init_where_clause, init_where_params = MoveLine.with_context(date_from=self.env.context.get('date_from'), date_to=False, initial_bal=True)._query_get() - init_wheres = [""] - if init_where_clause.strip(): - init_wheres.append(init_where_clause.strip()) - init_filters = " AND ".join(init_wheres) - filters = init_filters.replace('account_move_line__move_id', 'm').replace('account_move_line', 'l') - sql = ("""SELECT 0 AS lid, l.account_id AS account_id, '' AS ldate, '' AS lcode, 0.0 AS amount_currency, '' AS lref, 'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit, COALESCE(SUM(l.credit),0.0) AS credit, COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance, '' AS lpartner_id,\ - '' AS move_name, '' AS mmove_id, '' AS currency_code,\ - NULL AS currency_id,\ - '' AS invoice_id, '' AS invoice_type, '' AS invoice_number,\ - '' AS partner_name\ - FROM account_move_line l\ - LEFT JOIN account_move m ON (l.move_id=m.id)\ - LEFT JOIN res_currency c ON (l.currency_id=c.id)\ - LEFT JOIN res_partner p ON (l.partner_id=p.id)\ - LEFT JOIN account_invoice i ON (m.id =i.move_id)\ - JOIN account_journal j ON (l.journal_id=j.id)\ - WHERE l.account_id IN %s""" + filters + ' GROUP BY l.account_id') - params = (tuple(accounts.ids),) + tuple(init_where_params) - cr.execute(sql, params) - for row in cr.dictfetchall(): - move_lines[row.pop('account_id')].append(row) - - sql_sort = 'l.date, l.move_id' - if sortby == 'sort_journal_partner': - sql_sort = 'j.code, p.name, l.move_id' - - # Prepare sql query base on selected parameters from wizard - tables, where_clause, where_params = MoveLine._query_get() - wheres = [""] - if where_clause.strip(): - wheres.append(where_clause.strip()) - filters = " AND ".join(wheres) - filters = filters.replace('account_move_line__move_id', 'm').replace('account_move_line', 'l') - - # Get move lines base on sql query and Calculate the total balance of move lines - sql = ('''SELECT l.id AS lid, l.account_id AS account_id, l.date AS ldate, j.code AS lcode, l.currency_id, l.amount_currency, l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) AS balance,\ - m.name AS move_name, c.symbol AS currency_code, p.name AS partner_name\ - FROM account_move_line l\ - JOIN account_move m ON (l.move_id=m.id)\ - LEFT JOIN res_currency c ON (l.currency_id=c.id)\ - LEFT JOIN res_partner p ON (l.partner_id=p.id)\ - JOIN account_journal j ON (l.journal_id=j.id)\ - JOIN account_account acc ON (l.account_id = acc.id) \ - WHERE l.account_id IN %s ''' + filters + ''' GROUP BY l.id, l.account_id, l.date, j.code, l.currency_id, l.amount_currency, l.ref, l.name, m.name, c.symbol, p.name ORDER BY ''' + sql_sort) - params = (tuple(accounts.ids),) + tuple(where_params) - cr.execute(sql, params) - - for row in cr.dictfetchall(): - balance = 0 - for line in move_lines.get(row['account_id']): - balance += line['debit'] - line['credit'] - row['balance'] += balance - move_lines[row.pop('account_id')].append(row) - - # Calculate the debit, credit and balance for Accounts - account_res = [] - for account in accounts: - currency = account.currency_id and account.currency_id or account.company_id.currency_id - res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance']) - res['code'] = account.code - res['name'] = account.name - res['move_lines'] = move_lines[account.id] - for line in res.get('move_lines'): - res['debit'] += line['debit'] - res['credit'] += line['credit'] - res['balance'] = line['balance'] - if display_account == 'all': - account_res.append(res) - if display_account == 'movement' and res.get('move_lines'): - account_res.append(res) - if display_account == 'not_zero' and not currency.is_zero(res['balance']): - account_res.append(res) - - return account_res - - @api.model - def _get_report_values(self, docids, data=None): - if not data.get('form') or not self.env.context.get('active_model'): - raise UserError(_("Form content is missing, this report cannot be printed.")) - - self.model = self.env.context.get('active_model') - docs = self.env[self.model].browse(self.env.context.get('active_ids', [])) - - init_balance = data['form'].get('initial_balance', True) - sortby = data['form'].get('sortby', 'sort_date') - display_account = data['form']['display_account'] - codes = [] - if data['form'].get('journal_ids', False): - codes = [journal.code for journal in self.env['account.journal'].search([('id', 'in', data['form']['journal_ids'])])] - - accounts = docs if self.model == 'account.account' else self.env['account.account'].search([]) - accounts_res = self.with_context(data['form'].get('used_context',{}))._get_account_move_entry(accounts, init_balance, sortby, display_account) - return { - 'doc_ids': docids, - 'doc_model': self.model, - 'data': data['form'], - 'docs': docs, - 'time': time, - 'Accounts': accounts_res, - 'print_journal': codes, - 'company_id': self.env['res.company'].browse( - data['form']['company_id'][0]), - } diff --git a/addons/account/report/account_overdue_report.py b/addons/account/report/account_overdue_report.py deleted file mode 100644 index 5a76419ad8e..00000000000 --- a/addons/account/report/account_overdue_report.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- - -import time -from odoo import api, fields, models - - -class ReportOverdue(models.AbstractModel): - _name = 'report.account.report_overdue' - _description = 'Account Overdue Report' - - def _get_account_move_lines(self, partner_ids): - res = {x: [] for x in partner_ids} - self.env.cr.execute("SELECT m.name AS move_id, l.date, l.name, l.ref, l.date_maturity, l.partner_id, l.blocked, l.amount_currency, l.currency_id, " - "CASE WHEN at.type = 'receivable' " - "THEN SUM(l.debit) " - "ELSE SUM(l.credit * -1) " - "END AS debit, " - "CASE WHEN at.type = 'receivable' " - "THEN SUM(l.credit) " - "ELSE SUM(l.debit * -1) " - "END AS credit, " - "CASE WHEN l.date_maturity < %s " - "THEN SUM(l.debit - l.credit) " - "ELSE 0 " - "END AS mat " - "FROM account_move_line l " - "JOIN account_account_type at ON (l.user_type_id = at.id) " - "JOIN account_move m ON (l.move_id = m.id) " - "WHERE l.partner_id IN %s AND at.type IN ('receivable', 'payable') AND l.full_reconcile_id IS NULL GROUP BY l.date, l.name, l.ref, l.date_maturity, l.partner_id, at.type, l.blocked, l.amount_currency, l.currency_id, l.move_id, m.name", (((fields.date.today(), ) + (tuple(partner_ids),)))) - for row in self.env.cr.dictfetchall(): - res[row.pop('partner_id')].append(row) - return res - - @api.model - def _get_report_values(self, docids, data=None): - totals = {} - lines = self._get_account_move_lines(docids) - lines_to_display = {} - company_currency = self.env.user.company_id.currency_id - for partner_id in docids: - lines_to_display[partner_id] = {} - totals[partner_id] = {} - for line_tmp in lines[partner_id]: - line = line_tmp.copy() - currency = line['currency_id'] and self.env['res.currency'].browse(line['currency_id']) or company_currency - if currency not in lines_to_display[partner_id]: - lines_to_display[partner_id][currency] = [] - totals[partner_id][currency] = dict((fn, 0.0) for fn in ['due', 'paid', 'mat', 'total']) - if line['debit'] and line['currency_id']: - line['debit'] = line['amount_currency'] - if line['credit'] and line['currency_id']: - line['credit'] = line['amount_currency'] - if line['mat'] and line['currency_id']: - line['mat'] = line['amount_currency'] - lines_to_display[partner_id][currency].append(line) - if not line['blocked']: - totals[partner_id][currency]['due'] += line['debit'] - totals[partner_id][currency]['paid'] += line['credit'] - totals[partner_id][currency]['mat'] += line['mat'] - totals[partner_id][currency]['total'] += line['debit'] - line['credit'] - return { - 'doc_ids': docids, - 'doc_model': 'res.partner', - 'docs': self.env['res.partner'].browse(docids), - 'time': time, - 'Lines': lines_to_display, - 'Totals': totals, - 'Date': fields.date.today(), - 'company_id': self.env['res.company'].browse([self.env.user.company_id.id]), - } diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py deleted file mode 100644 index 3b0b9e276cc..00000000000 --- a/addons/account/report/account_partner_ledger.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- - -from datetime import datetime -import time -from odoo import api, models, _ -from odoo.exceptions import UserError - - -class ReportPartnerLedger(models.AbstractModel): - _name = 'report.account.report_partnerledger' - _description = 'Partner Ledger Report' - - def _lines(self, data, partner): - full_account = [] - currency = self.env['res.currency'] - query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() - reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL ' - params = [partner.id, tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] - query = """ - SELECT "account_move_line".id, "account_move_line".date, j.code, acc.code as a_code, acc.name as a_name, "account_move_line".ref, m.name as move_name, "account_move_line".name, "account_move_line".debit, "account_move_line".credit, "account_move_line".amount_currency,"account_move_line".currency_id, c.symbol AS currency_code - FROM """ + query_get_data[0] + """ - LEFT JOIN account_journal j ON ("account_move_line".journal_id = j.id) - LEFT JOIN account_account acc ON ("account_move_line".account_id = acc.id) - LEFT JOIN res_currency c ON ("account_move_line".currency_id=c.id) - LEFT JOIN account_move m ON (m.id="account_move_line".move_id) - WHERE "account_move_line".partner_id = %s - AND m.state IN %s - AND "account_move_line".account_id IN %s AND """ + query_get_data[1] + reconcile_clause + """ - ORDER BY "account_move_line".date""" - self.env.cr.execute(query, tuple(params)) - res = self.env.cr.dictfetchall() - sum = 0.0 - lang_code = self.env.context.get('lang') or 'en_US' - lang = self.env['res.lang'] - lang_id = lang._lang_get(lang_code) - date_format = lang_id.date_format - for r in res: - r['displayed_name'] = '-'.join( - r[field_name] for field_name in ('move_name', 'ref', 'name') - if r[field_name] not in (None, '', '/') - ) - sum += r['debit'] - r['credit'] - r['progress'] = sum - r['currency_id'] = currency.browse(r.get('currency_id')) - full_account.append(r) - return full_account - - def _sum_partner(self, data, partner, field): - if field not in ['debit', 'credit', 'debit - credit']: - return - result = 0.0 - query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() - reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL ' - - params = [partner.id, tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] - query = """SELECT sum(""" + field + """) - FROM """ + query_get_data[0] + """, account_move AS m - WHERE "account_move_line".partner_id = %s - AND m.id = "account_move_line".move_id - AND m.state IN %s - AND account_id IN %s - AND """ + query_get_data[1] + reconcile_clause - self.env.cr.execute(query, tuple(params)) - - contemp = self.env.cr.fetchone() - if contemp is not None: - result = contemp[0] or 0.0 - return result - - @api.model - def _get_report_values(self, docids, data=None): - if not data.get('form'): - raise UserError(_("Form content is missing, this report cannot be printed.")) - - data['computed'] = {} - - obj_partner = self.env['res.partner'] - query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() - data['computed']['move_state'] = ['draft', 'posted'] - if data['form'].get('target_move', 'all') == 'posted': - data['computed']['move_state'] = ['posted'] - result_selection = data['form'].get('result_selection', 'customer') - if result_selection == 'supplier': - data['computed']['ACCOUNT_TYPE'] = ['payable'] - elif result_selection == 'customer': - data['computed']['ACCOUNT_TYPE'] = ['receivable'] - else: - data['computed']['ACCOUNT_TYPE'] = ['payable', 'receivable'] - - self.env.cr.execute(""" - SELECT a.id - FROM account_account a - WHERE a.internal_type IN %s - AND NOT a.deprecated""", (tuple(data['computed']['ACCOUNT_TYPE']),)) - data['computed']['account_ids'] = [a for (a,) in self.env.cr.fetchall()] - params = [tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] - reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL ' - query = """ - SELECT DISTINCT "account_move_line".partner_id - FROM """ + query_get_data[0] + """, account_account AS account, account_move AS am - WHERE "account_move_line".partner_id IS NOT NULL - AND "account_move_line".account_id = account.id - AND am.id = "account_move_line".move_id - AND am.state IN %s - AND "account_move_line".account_id IN %s - AND NOT account.deprecated - AND """ + query_get_data[1] + reconcile_clause - self.env.cr.execute(query, tuple(params)) - partner_ids = [res['partner_id'] for res in self.env.cr.dictfetchall()] - partners = obj_partner.browse(partner_ids) - partners = sorted(partners, key=lambda x: (x.ref or '', x.name or '')) - - return { - 'doc_ids': partner_ids, - 'doc_model': self.env['res.partner'], - 'data': data, - 'docs': partners, - 'time': time, - 'lines': self._lines, - 'sum_partner': self._sum_partner, - 'company_id': self.env['res.company'].browse( - data['form']['company_id'][0]), - } diff --git a/addons/account/report/account_report_financial.py b/addons/account/report/account_report_financial.py deleted file mode 100644 index 129cd6a7114..00000000000 --- a/addons/account/report/account_report_financial.py +++ /dev/null @@ -1,164 +0,0 @@ -# -*- coding: utf-8 -*- - -import time -from odoo import api, models, _ -from odoo.exceptions import UserError - - -class ReportFinancial(models.AbstractModel): - _name = 'report.account.report_financial' - _description = 'Financial Report' - - def _compute_account_balance(self, accounts): - """ compute the balance, debit and credit for the provided accounts - """ - mapping = { - 'balance': "COALESCE(SUM(debit),0) - COALESCE(SUM(credit), 0) as balance", - 'debit': "COALESCE(SUM(debit), 0) as debit", - 'credit': "COALESCE(SUM(credit), 0) as credit", - } - - res = {} - for account in accounts: - res[account.id] = dict.fromkeys(mapping, 0.0) - if accounts: - tables, where_clause, where_params = self.env['account.move.line']._query_get() - tables = tables.replace('"', '') if tables else "account_move_line" - wheres = [""] - if where_clause.strip(): - wheres.append(where_clause.strip()) - filters = " AND ".join(wheres) - request = "SELECT account_id as id, " + ', '.join(mapping.values()) + \ - " FROM " + tables + \ - " WHERE account_id IN %s " \ - + filters + \ - " GROUP BY account_id" - params = (tuple(accounts._ids),) + tuple(where_params) - self.env.cr.execute(request, params) - for row in self.env.cr.dictfetchall(): - res[row['id']] = row - return res - - def _compute_report_balance(self, reports): - '''returns a dictionary with key=the ID of a record and value=the credit, debit and balance amount - computed for this record. If the record is of type : - 'accounts' : it's the sum of the linked accounts - 'account_type' : it's the sum of leaf accounts with such an account_type - 'account_report' : it's the amount of the related report - 'sum' : it's the sum of the children of this record (aka a 'view' record)''' - res = {} - fields = ['credit', 'debit', 'balance'] - for report in reports: - if report.id in res: - continue - res[report.id] = dict((fn, 0.0) for fn in fields) - if report.type == 'accounts': - # it's the sum of the linked accounts - res[report.id]['account'] = self._compute_account_balance(report.account_ids) - for value in res[report.id]['account'].values(): - for field in fields: - res[report.id][field] += value.get(field) - elif report.type == 'account_type': - # it's the sum the leaf accounts with such an account type - accounts = self.env['account.account'].search([('user_type_id', 'in', report.account_type_ids.ids)]) - res[report.id]['account'] = self._compute_account_balance(accounts) - for value in res[report.id]['account'].values(): - for field in fields: - res[report.id][field] += value.get(field) - elif report.type == 'account_report' and report.account_report_id: - # it's the amount of the linked report - res2 = self._compute_report_balance(report.account_report_id) - for key, value in res2.items(): - for field in fields: - res[report.id][field] += value[field] - elif report.type == 'sum': - # it's the sum of the children of this account.report - res2 = self._compute_report_balance(report.children_ids) - for key, value in res2.items(): - for field in fields: - res[report.id][field] += value[field] - return res - - def get_account_lines(self, data): - lines = [] - account_report = self.env['account.financial.report'].search([('id', '=', data['account_report_id'][0])]) - child_reports = account_report._get_children_by_order() - res = self.with_context(data.get('used_context'))._compute_report_balance(child_reports) - if data['enable_filter']: - comparison_res = self.with_context(data.get('comparison_context'))._compute_report_balance(child_reports) - for report_id, value in comparison_res.items(): - res[report_id]['comp_bal'] = value['balance'] - report_acc = res[report_id].get('account') - if report_acc: - for account_id, val in comparison_res[report_id].get('account').items(): - report_acc[account_id]['comp_bal'] = val['balance'] - - for report in child_reports: - vals = { - 'name': report.name, - 'balance': res[report.id]['balance'] * report.sign, - 'type': 'report', - 'level': bool(report.style_overwrite) and report.style_overwrite or report.level, - 'account_type': report.type or False, #used to underline the financial report balances - } - if data['debit_credit']: - vals['debit'] = res[report.id]['debit'] - vals['credit'] = res[report.id]['credit'] - - if data['enable_filter']: - vals['balance_cmp'] = res[report.id]['comp_bal'] * report.sign - - lines.append(vals) - if report.display_detail == 'no_detail': - #the rest of the loop is used to display the details of the financial report, so it's not needed here. - continue - - if res[report.id].get('account'): - sub_lines = [] - for account_id, value in res[report.id]['account'].items(): - #if there are accounts to display, we add them to the lines with a level equals to their level in - #the COA + 1 (to avoid having them with a too low level that would conflicts with the level of data - #financial reports for Assets, liabilities...) - flag = False - account = self.env['account.account'].browse(account_id) - vals = { - 'name': account.code + ' ' + account.name, - 'balance': value['balance'] * report.sign or 0.0, - 'type': 'account', - 'level': report.display_detail == 'detail_with_hierarchy' and 4, - 'account_type': account.internal_type, - } - if data['debit_credit']: - vals['debit'] = value['debit'] - vals['credit'] = value['credit'] - if not account.company_id.currency_id.is_zero(vals['debit']) or not account.company_id.currency_id.is_zero(vals['credit']): - flag = True - if not account.company_id.currency_id.is_zero(vals['balance']): - flag = True - if data['enable_filter']: - vals['balance_cmp'] = value['comp_bal'] * report.sign - if not account.company_id.currency_id.is_zero(vals['balance_cmp']): - flag = True - if flag: - sub_lines.append(vals) - lines += sorted(sub_lines, key=lambda sub_line: sub_line['name']) - return lines - - @api.model - def _get_report_values(self, docids, data=None): - if not data.get('form') or not self.env.context.get('active_model') or not self.env.context.get('active_id'): - raise UserError(_("Form content is missing, this report cannot be printed.")) - - self.model = self.env.context.get('active_model') - docs = self.env[self.model].browse(self.env.context.get('active_id')) - report_lines = self.get_account_lines(data.get('form')) - return { - 'doc_ids': self.ids, - 'doc_model': self.model, - 'data': data['form'], - 'docs': docs, - 'time': time, - 'get_account_lines': report_lines, - 'company_id': self.env['res.company'].browse( - data['form']['company_id'][0]), - } diff --git a/addons/account/report/account_tax.py b/addons/account/report/account_tax.py deleted file mode 100644 index ca8945b9a6f..00000000000 --- a/addons/account/report/account_tax.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import api, models, _ -from odoo.exceptions import UserError - - -class ReportTax(models.AbstractModel): - _name = 'report.account.report_tax' - _description = 'Tax Report' - - @api.model - def _get_report_values(self, docids, data=None): - if not data.get('form'): - raise UserError(_("Form content is missing, this report cannot be printed.")) - return { - 'data': data['form'], - 'lines': self.get_lines(data.get('form')), - 'company_id': self.env['res.company'].browse( - data['form']['company_id'][0]), - } - - def _sql_from_amls_one(self): - sql = """SELECT "account_move_line".tax_line_id, COALESCE(SUM("account_move_line".debit-"account_move_line".credit), 0) - FROM %s - WHERE %s AND "account_move_line".tax_exigible GROUP BY "account_move_line".tax_line_id""" - return sql - - def _sql_from_amls_two(self): - sql = """SELECT r.account_tax_id, COALESCE(SUM("account_move_line".debit-"account_move_line".credit), 0) - FROM %s - INNER JOIN account_move_line_account_tax_rel r ON ("account_move_line".id = r.account_move_line_id) - INNER JOIN account_tax t ON (r.account_tax_id = t.id) - WHERE %s AND "account_move_line".tax_exigible GROUP BY r.account_tax_id""" - return sql - - def _compute_from_amls(self, options, taxes): - #compute the tax amount - sql = self._sql_from_amls_one() - tables, where_clause, where_params = self.env['account.move.line']._query_get() - query = sql % (tables, where_clause) - self.env.cr.execute(query, where_params) - results = self.env.cr.fetchall() - for result in results: - if result[0] in taxes: - taxes[result[0]]['tax'] = abs(result[1]) - - #compute the net amount - sql2 = self._sql_from_amls_two() - query = sql2 % (tables, where_clause) - self.env.cr.execute(query, where_params) - results = self.env.cr.fetchall() - for result in results: - if result[0] in taxes: - taxes[result[0]]['net'] = abs(result[1]) - - @api.model - def get_lines(self, options): - taxes = {} - for tax in self.env['account.tax'].search([('type_tax_use', '!=', 'none')]): - if tax.children_tax_ids: - for child in tax.children_tax_ids: - if child.type_tax_use != 'none': - continue - taxes[child.id] = {'tax': 0, 'net': 0, 'name': child.name, 'type': tax.type_tax_use} - else: - taxes[tax.id] = {'tax': 0, 'net': 0, 'name': tax.name, 'type': tax.type_tax_use} - self.with_context(date_from=options['date_from'], date_to=options['date_to'], strict_range=True)._compute_from_amls(options, taxes) - groups = dict((tp, []) for tp in ['sale', 'purchase']) - for tax in taxes.values(): - if tax['tax']: - groups[tax['type']].append(tax) - return groups diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index ea0ed06ee08..52ac52ad108 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -67,8 +67,6 @@ access_account_invoice_line_accountant,account.invoice.line accountant,model_acc access_account_account_invoice,account.account invoice,model_account_account,account.group_account_invoice,1,0,0,0 access_account_analytic_accountant,account.analytic.account accountant,analytic.model_account_analytic_account,account.group_account_user,1,1,1,1 access_account_account_type_invoice,account.account.type invoice,model_account_account_type,account.group_account_invoice,1,0,0,0 -access_account_financial_report,account.financial.report,model_account_financial_report,account.group_account_user,1,1,1,1 -access_account_financial_report_invoice,account.financial.report invoice,model_account_financial_report,account.group_account_invoice,1,0,0,0 access_account_account_tax,account.account.tag,model_account_account_tag,account.group_account_user,1,1,1,1 access_account_account_tax_user,account.account.tag,model_account_account_tag,account.group_account_invoice,1,0,0,0 access_account_reconcile_model,account.reconcile.model,model_account_reconcile_model,account.group_account_user,1,1,1,1 diff --git a/addons/account/views/account_menuitem.xml b/addons/account/views/account_menuitem.xml index a6ff04f5405..14f667247ad 100644 --- a/addons/account/views/account_menuitem.xml +++ b/addons/account/views/account_menuitem.xml @@ -17,12 +17,11 @@ + - - @@ -30,7 +29,6 @@ - diff --git a/addons/account/views/account_report.xml b/addons/account/views/account_report.xml index 6db3ee4cea4..17341cccc0e 100644 --- a/addons/account/views/account_report.xml +++ b/addons/account/views/account_report.xml @@ -25,44 +25,6 @@ print_report_name="(object._get_report_base_filename())" /> - - - - - - - - - - - - diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index f4e1d6863eb..d87af097884 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -2300,77 +2300,6 @@ parent="account.menu_finance_payables" action="base.action_partner_supplier_form" sequence="200"/> - - - - account.financial.report.form - account.financial.report - -
- - - - - - - - - - - - - - - - - - -
-
-
- - - account.financial.report.tree - account.financial.report - - - - - - - - - - - - account.financial.report.search - account.financial.report - - - - - - - - - - - - - - - Financial Reports - ir.actions.act_window - account.financial.report - form - tree,form - - - - - - - Reconciliation diff --git a/addons/account/views/report_financial.xml b/addons/account/views/report_financial.xml deleted file mode 100644 index 24774bd9c08..00000000000 --- a/addons/account/views/report_financial.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - diff --git a/addons/account/views/report_generalledger.xml b/addons/account/views/report_generalledger.xml deleted file mode 100644 index d43240d65eb..00000000000 --- a/addons/account/views/report_generalledger.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - diff --git a/addons/account/views/report_overdue.xml b/addons/account/views/report_overdue.xml deleted file mode 100644 index 84e44043303..00000000000 --- a/addons/account/views/report_overdue.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - diff --git a/addons/account/views/report_partnerledger.xml b/addons/account/views/report_partnerledger.xml deleted file mode 100644 index 1f4c88d21d1..00000000000 --- a/addons/account/views/report_partnerledger.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - diff --git a/addons/account/report/account_report_payment_receipt_templates.xml b/addons/account/views/report_payment_receipt_templates.xml similarity index 100% rename from addons/account/report/account_report_payment_receipt_templates.xml rename to addons/account/views/report_payment_receipt_templates.xml diff --git a/addons/account/views/report_tax.xml b/addons/account/views/report_tax.xml deleted file mode 100644 index 56cf940a94a..00000000000 --- a/addons/account/views/report_tax.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - diff --git a/addons/account/views/report_trialbalance.xml b/addons/account/views/report_trialbalance.xml deleted file mode 100644 index 6ae4aec92c7..00000000000 --- a/addons/account/views/report_trialbalance.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py index d8440f9e57c..0e5b3bf4df4 100644 --- a/addons/account/wizard/__init__.py +++ b/addons/account/wizard/__init__.py @@ -9,16 +9,8 @@ from . import account_validate_account_move from . import pos_box from . import account_move_reversal from . import account_report_common -from . import account_report_common_account -from . import account_report_common_partner from . import account_report_common_journal from . import account_report_print_journal -from . import account_report_general_ledger -from . import account_report_partner_ledger -from . import account_report_trial_balance -from . import account_financial_report -from . import account_report_aged_partner_balance from . import setup_wizards from . import wizard_tax_adjustments -from . import account_report_tax from . import account_invoice_send diff --git a/addons/account/wizard/account_financial_report.py b/addons/account/wizard/account_financial_report.py deleted file mode 100644 index 00f04b61329..00000000000 --- a/addons/account/wizard/account_financial_report.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import api, fields, models - - -class AccountingReport(models.TransientModel): - _name = "accounting.report" - _inherit = "account.common.report" - _description = "Accounting Report" - - @api.model - def _get_account_report(self): - reports = [] - if self._context.get('active_id'): - menu = self.env['ir.ui.menu'].browse(self._context.get('active_id')).name - reports = self.env['account.financial.report'].search([('name', 'ilike', menu)]) - return reports and reports[0] or False - - enable_filter = fields.Boolean(string='Enable Comparison') - account_report_id = fields.Many2one('account.financial.report', string='Account Reports', required=True, default=_get_account_report) - label_filter = fields.Char(string='Column Label', help="This label will be displayed on report to show the balance computed for the given comparison filter.") - filter_cmp = fields.Selection([('filter_no', 'No Filters'), ('filter_date', 'Date')], string='Filter by', required=True, default='filter_no') - date_from_cmp = fields.Date(string='Start Date Comparison') - date_to_cmp = fields.Date(string='End Date Comparison') - debit_credit = fields.Boolean(string='Display Debit/Credit Columns', help="This option allows you to get more details about the way your balances are computed. Because it is space consuming, we do not allow to use it while doing a comparison.") - - def _build_comparison_context(self, data): - result = {} - result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False - result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or '' - if data['form']['filter_cmp'] == 'filter_date': - result['date_from'] = data['form']['date_from_cmp'] - result['date_to'] = data['form']['date_to_cmp'] - result['strict_range'] = True - return result - - @api.multi - def check_report(self): - res = super(AccountingReport, self).check_report() - data = {} - data['form'] = self.read(['account_report_id', 'date_from_cmp', 'date_to_cmp', 'journal_ids', 'filter_cmp', 'target_move'])[0] - for field in ['account_report_id']: - if isinstance(data['form'][field], tuple): - data['form'][field] = data['form'][field][0] - comparison_context = self._build_comparison_context(data) - res['data']['form']['comparison_context'] = comparison_context - return res - - def _print_report(self, data): - data['form'].update(self.read(['date_from_cmp', 'debit_credit', 'date_to_cmp', 'filter_cmp', 'account_report_id', 'enable_filter', 'label_filter', 'target_move'])[0]) - return self.env.ref('account.action_report_financial').report_action(self, data=data, config=False) diff --git a/addons/account/wizard/account_financial_report_view.xml b/addons/account/wizard/account_financial_report_view.xml deleted file mode 100644 index 0d5763da812..00000000000 --- a/addons/account/wizard/account_financial_report_view.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Accounting Report - accounting.report - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Balance Sheet - accounting.report - ir.actions.act_window - form - form - - new - - - - - - - Profit and Loss - accounting.report - ir.actions.act_window - form - form - - new - - - - - - - Financial Reports - accounting.report - ir.actions.act_window - form - form - - new - - - - - diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py deleted file mode 100644 index 24a3d8766f6..00000000000 --- a/addons/account/wizard/account_report_aged_partner_balance.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- - -import time -from datetime import datetime -from dateutil.relativedelta import relativedelta -from odoo import api, fields, models, _ -from odoo.exceptions import UserError - - -class AccountAgedTrialBalance(models.TransientModel): - - _name = 'account.aged.trial.balance' - _inherit = 'account.common.partner.report' - _description = 'Aged Trial Balance Report' - - period_length = fields.Integer(string='Period Length (days)', required=True, default=30) - journal_ids = fields.Many2many('account.journal', string='Journals', required=True) - date_from = fields.Date(default=lambda *a: time.strftime('%Y-%m-%d')) - - def _print_report(self, data): - res = {} - data = self.pre_print_report(data) - data['form'].update(self.read(['period_length'])[0]) - period_length = data['form']['period_length'] - if period_length<=0: - raise UserError(_('You must set a period length greater than 0.')) - if not data['form']['date_from']: - raise UserError(_('You must set a start date.')) - - start = fields.Date.from_string(data['form']['date_from']) - - for i in range(5)[::-1]: - stop = start - relativedelta(days=period_length - 1) - res[str(i)] = { - 'name': (i!=0 and (str((5-(i+1)) * period_length +1) + '-' + str((5-i) * period_length)) or ('+'+str(4 * period_length))), - 'stop': start.strftime('%Y-%m-%d'), - 'start': (i!=0 and stop.strftime('%Y-%m-%d') or False), - } - start = stop - relativedelta(days=1) - data['form'].update(res) - return self.env.ref('account.action_report_aged_partner_balance').with_context(landscape=True).report_action(self, data=data) diff --git a/addons/account/wizard/account_report_aged_partner_balance_view.xml b/addons/account/wizard/account_report_aged_partner_balance_view.xml deleted file mode 100644 index c801bfebcd1..00000000000 --- a/addons/account/wizard/account_report_aged_partner_balance_view.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Aged Partner Balance - account.aged.trial.balance - -
- - Aged Partner Balance is a more detailed report of your receivables by intervals. Odoo calculates a table of credit balance by start Date. So if you request an interval of 30 days Odoo generates an analysis of creditors for the past month, past two months, and so on. - - - - - - - - - -
-
- -
-
- - - Aged Partner Balance - account.aged.trial.balance - ir.actions.act_window - form - tree,form - - {} - new - - - - -
diff --git a/addons/account/wizard/account_report_common_account.py b/addons/account/wizard/account_report_common_account.py deleted file mode 100644 index d8a9fc43a34..00000000000 --- a/addons/account/wizard/account_report_common_account.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import api, fields, models - - -class AccountCommonAccountReport(models.TransientModel): - _name = 'account.common.account.report' - _description = 'Common Account Report' - _inherit = "account.common.report" - - display_account = fields.Selection([('all','All'), ('movement','With movements'), - ('not_zero','With balance is not equal to 0'),], - string='Display Accounts', required=True, default='movement') - - @api.multi - def pre_print_report(self, data): - data['form'].update(self.read(['display_account'])[0]) - return data diff --git a/addons/account/wizard/account_report_common_partner.py b/addons/account/wizard/account_report_common_partner.py deleted file mode 100644 index ea2375087af..00000000000 --- a/addons/account/wizard/account_report_common_partner.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import fields, models - - -class AccountingCommonPartnerReport(models.TransientModel): - _name = 'account.common.partner.report' - _description = 'Common Partner Report' - _inherit = "account.common.report" - - result_selection = fields.Selection([('customer', 'Receivable Accounts'), - ('supplier', 'Payable Accounts'), - ('customer_supplier', 'Receivable and Payable Accounts') - ], string="Partner's", required=True, default='customer') - - def pre_print_report(self, data): - data['form'].update(self.read(['result_selection'])[0]) - return data diff --git a/addons/account/wizard/account_report_general_ledger.py b/addons/account/wizard/account_report_general_ledger.py deleted file mode 100644 index f61e008f162..00000000000 --- a/addons/account/wizard/account_report_general_ledger.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import fields, models, _ -from odoo.exceptions import UserError - - -class AccountReportGeneralLedger(models.TransientModel): - _inherit = "account.common.account.report" - _name = "account.report.general.ledger" - _description = "General Ledger Report" - - initial_balance = fields.Boolean(string='Include Initial Balances', - help='If you selected date, this field allow you to add a row to display the amount of debit/credit/balance that precedes the filter you\'ve set.') - sortby = fields.Selection([('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], string='Sort by', required=True, default='sort_date') - journal_ids = fields.Many2many('account.journal', 'account_report_general_ledger_journal_rel', 'account_id', 'journal_id', string='Journals', required=True) - - def _print_report(self, data): - data = self.pre_print_report(data) - data['form'].update(self.read(['initial_balance', 'sortby'])[0]) - if data['form'].get('initial_balance') and not data['form'].get('date_from'): - raise UserError(_("You must define a start Date")) - records = self.env[data['model']].browse(data.get('ids', [])) - return self.env.ref('account.action_report_general_ledger').with_context(landscape=True).report_action(records, data=data) diff --git a/addons/account/wizard/account_report_general_ledger_view.xml b/addons/account/wizard/account_report_general_ledger_view.xml deleted file mode 100644 index 680cd08849b..00000000000 --- a/addons/account/wizard/account_report_general_ledger_view.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - General Ledger - account.report.general.ledger - - - - - - - - - - - - - - - General Ledger - ir.actions.act_window - account.report.general.ledger - form - form - - new - - report - - - - - diff --git a/addons/account/wizard/account_report_partner_ledger.py b/addons/account/wizard/account_report_partner_ledger.py deleted file mode 100644 index e9e533dbcd4..00000000000 --- a/addons/account/wizard/account_report_partner_ledger.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import fields, models, _ -from odoo.exceptions import UserError - - -class AccountPartnerLedger(models.TransientModel): - _inherit = "account.common.partner.report" - _name = "account.report.partner.ledger" - _description = "Account Partner Ledger Report" - - amount_currency = fields.Boolean("With Currency", help="It adds the currency column on report if the currency differs from the company currency.") - reconciled = fields.Boolean('Reconciled Entries') - - def _print_report(self, data): - data = self.pre_print_report(data) - data['form'].update({'reconciled': self.reconciled, 'amount_currency': self.amount_currency}) - return self.env.ref('account.action_report_partnerledger').report_action(self, data=data) diff --git a/addons/account/wizard/account_report_partner_ledger_view.xml b/addons/account/wizard/account_report_partner_ledger_view.xml deleted file mode 100644 index 62f05c655d1..00000000000 --- a/addons/account/wizard/account_report_partner_ledger_view.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Partner Ledger - account.report.partner.ledger - - - - - - - - - - - - - - - - Partner Ledger - ir.actions.act_window - account.report.partner.ledger - form - form - - new - - report - - - - - diff --git a/addons/account/wizard/account_report_print_journal_view.xml b/addons/account/wizard/account_report_print_journal_view.xml deleted file mode 100644 index 5103f6aabea..00000000000 --- a/addons/account/wizard/account_report_print_journal_view.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Journals Audit - account.print.journal - - - - - - - - - - - - - - Journals Audit - ir.actions.act_window - account.print.journal - form - form - - new - - - - - diff --git a/addons/account/wizard/account_report_tax.py b/addons/account/wizard/account_report_tax.py deleted file mode 100644 index 4e2c2e21e5d..00000000000 --- a/addons/account/wizard/account_report_tax.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import models - - -class AccountTaxReport(models.TransientModel): - _inherit = "account.common.report" - _name = 'account.tax.report' - _description = 'Tax Report' - - def _print_report(self, data): - return self.env.ref('account.action_report_account_tax').report_action(self, data=data) diff --git a/addons/account/wizard/account_report_tax_view.xml b/addons/account/wizard/account_report_tax_view.xml deleted file mode 100644 index a65ae7b05ea..00000000000 --- a/addons/account/wizard/account_report_tax_view.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Tax Reports - account.tax.report - - - - - - - 1 - - - 1 - - - - - - - Tax Reports - account.tax.report - ir.actions.act_window - form - form - - {} - new - - - - - diff --git a/addons/account/wizard/account_report_trial_balance.py b/addons/account/wizard/account_report_trial_balance.py deleted file mode 100644 index 38809a9566c..00000000000 --- a/addons/account/wizard/account_report_trial_balance.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import fields, models - - -class AccountBalanceReport(models.TransientModel): - _inherit = "account.common.account.report" - _name = 'account.balance.report' - _description = 'Trial Balance Report' - - journal_ids = fields.Many2many('account.journal', 'account_balance_report_journal_rel', 'account_id', 'journal_id', string='Journals', required=True, default=[]) - - def _print_report(self, data): - data = self.pre_print_report(data) - records = self.env[data['model']].browse(data.get('ids', [])) - return self.env.ref('account.action_report_trial_balance').report_action(records, data=data) diff --git a/addons/account/wizard/account_report_trial_balance_view.xml b/addons/account/wizard/account_report_trial_balance_view.xml deleted file mode 100644 index 12c0f34dd58..00000000000 --- a/addons/account/wizard/account_report_trial_balance_view.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - Trial Balance - account.balance.report - - - - - - - - - - - - - - Trial Balance - ir.actions.act_window - account.balance.report - form - form - - new - - report - - - - -