From 4202009086d4b112c54e8d9ab058dcd1178636eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Dieudonn=C3=A9?= Date: Wed, 31 Aug 2022 07:49:45 +0000 Subject: [PATCH] [REF] account: remove unused views and model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit deletes all unsused views from the following models: - `account.chart.template` - `account.account.template` - `account.common.report` We also take the oppoturnity to remove ´account.common.report´. This model is unused since https://github.com/odoo/odoo/commit/b7232b14b7f2423241b24b4eef1300f1a1b425cf#diff-61c2936e0566472acce71f3bb90f47ca5a709680322621dbcb735e3e2bd92f7eL11 This is a preliminary work in order to convert form views into grid. Related commit: https://github.com/odoo/odoo/commit/c04065abd8f62c9a211c8fa824f5eecf68e61b73#diff-f292b09f5efe026c65c27c5f0175b719a5d66999cbb15832c211796617ac082dL1976 closes odoo/odoo#99810 Related: odoo/upgrade#3875 Signed-off-by: William André (wan) --- addons/account/__manifest__.py | 1 - addons/account/security/ir.model.access.csv | 1 - .../views/account_chart_template_views.xml | 121 ------------------ addons/account/wizard/__init__.py | 1 - .../account/wizard/account_report_common.py | 54 -------- .../wizard/account_report_common_view.xml | 26 ---- 6 files changed, 204 deletions(-) delete mode 100644 addons/account/wizard/account_report_common.py delete mode 100644 addons/account/wizard/account_report_common_view.xml diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index afa3a5df2cf..5c2c59c2321 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -52,7 +52,6 @@ You could use this simplified accounting in case you work with an (external) acc 'views/report_invoice.xml', 'report/account_invoice_report_view.xml', 'views/account_cash_rounding_view.xml', - 'wizard/account_report_common_view.xml', 'views/ir_module_views.xml', 'views/res_config_settings_views.xml', 'views/partner_view.xml', diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index 68ed16e088a..d59e76a0e61 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -126,7 +126,6 @@ access_account_resequence,access.account.resequence.wizard,model_account_reseque access_validate_account_move,access.validate.account.move,model_validate_account_move,account.group_account_invoice,1,1,1,0 access_cash_box_out,access.cash.box.out,model_cash_box_out,account.group_account_user,1,1,1,0 access_account_move_reversal,access.account.move.reversal,model_account_move_reversal,account.group_account_invoice,1,1,1,0 -access_account_common_report,access.account.common.report,model_account_common_report,account.group_account_user,1,1,1,0 access_account_financial_year_op,access.account.financial.year.op,model_account_financial_year_op,account.group_account_manager,1,1,1,0 access_account_setup_bank_manual_config,access.account.setup.bank.manual.config,model_account_setup_bank_manual_config,account.group_account_manager,1,1,1,0 access_account_invoice_send,access.account.invoice.send,model_account_invoice_send,account.group_account_invoice,1,1,1,0 diff --git a/addons/account/views/account_chart_template_views.xml b/addons/account/views/account_chart_template_views.xml index aaea12ed0e8..ad8e09e7da2 100644 --- a/addons/account/views/account_chart_template_views.xml +++ b/addons/account/views/account_chart_template_views.xml @@ -2,127 +2,6 @@ - - - - account.chart.template.form - account.chart.template - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - account.chart.template.search - account.chart.template - - - - - - - - - - - - - - - - - - account.chart.template.tree - account.chart.template - - - - - - - - - - - - Chart of Accounts Templates - account.chart.template - tree,form - - - - - - - account.account.template.form - account.account.template - -
- - - - - - - - - - - - - - - - -
- - - account.account.template.tree - account.account.template - - - - - - - - - - - account.account.template.search - account.account.template - - - - - - - - - - - diff --git a/addons/account/wizard/__init__.py b/addons/account/wizard/__init__.py index ba93fa2cc34..4f371a2783b 100644 --- a/addons/account/wizard/__init__.py +++ b/addons/account/wizard/__init__.py @@ -7,7 +7,6 @@ from . import account_unreconcile from . import account_validate_account_move from . import pos_box from . import account_move_reversal -from . import account_report_common from . import account_resequence from . import setup_wizards from . import account_invoice_send diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py deleted file mode 100644 index 65bed2a9df8..00000000000 --- a/addons/account/wizard/account_report_common.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import api, fields, models, _ -from odoo.tools.misc import get_lang - - -class AccountCommonReport(models.TransientModel): - _name = "account.common.report" - _description = "Account Common Report" - - company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True, default=lambda self: self.env.company) - journal_ids = fields.Many2many( - comodel_name='account.journal', - string='Journals', - required=True, - default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]), - domain="[('company_id', '=', company_id)]", - ) - date_from = fields.Date(string='Start Date') - date_to = fields.Date(string='End Date') - target_move = fields.Selection([('posted', 'All Posted Entries'), - ('all', 'All Entries'), - ], string='Target Moves', required=True, default='posted') - - @api.onchange('company_id') - def _onchange_company_id(self): - if self.company_id: - self.journal_ids = self.env['account.journal'].search( - [('company_id', '=', self.company_id.id)]) - else: - self.journal_ids = self.env['account.journal'].search([]) - - def _build_contexts(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 '' - result['date_from'] = data['form']['date_from'] or False - result['date_to'] = data['form']['date_to'] or False - result['strict_range'] = True if result['date_from'] else False - result['company_id'] = data['form']['company_id'][0] or False - return result - - def _print_report(self, data): - raise NotImplementedError() - - def check_report(self): - self.ensure_one() - data = {} - data['ids'] = self.env.context.get('active_ids', []) - data['model'] = self.env.context.get('active_model', 'ir.ui.menu') - data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0] - used_context = self._build_contexts(data) - data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code) - return self.with_context(discard_logo_check=True)._print_report(data) diff --git a/addons/account/wizard/account_report_common_view.xml b/addons/account/wizard/account_report_common_view.xml deleted file mode 100644 index 6b15254e816..00000000000 --- a/addons/account/wizard/account_report_common_view.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Common Report - account.common.report - -
- - - - - - - - - - -
-
-
- -