From a12f472459774f70d646764a80e080c51dee20e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 30 Oct 2024 16:23:40 +0100 Subject: [PATCH] account_invoice_accrual: remove settings that should be in the base module --- account_invoice_accrual/models/__init__.py | 1 - account_invoice_accrual/models/res_company.py | 16 --------- account_invoice_accrual/wizards/__init__.py | 1 - .../wizards/account_move_accrue.py | 11 +----- .../wizards/res_config_settings.py | 16 --------- .../wizards/res_config_settings.xml | 35 ------------------- 6 files changed, 1 insertion(+), 79 deletions(-) delete mode 100644 account_invoice_accrual/models/res_company.py delete mode 100644 account_invoice_accrual/wizards/res_config_settings.py delete mode 100644 account_invoice_accrual/wizards/res_config_settings.xml diff --git a/account_invoice_accrual/models/__init__.py b/account_invoice_accrual/models/__init__.py index 92efc060f13..0d5ab6a2fc6 100644 --- a/account_invoice_accrual/models/__init__.py +++ b/account_invoice_accrual/models/__init__.py @@ -1,3 +1,2 @@ from . import account_move from . import account_move_line -from . import res_company diff --git a/account_invoice_accrual/models/res_company.py b/account_invoice_accrual/models/res_company.py deleted file mode 100644 index 629c63088bc..00000000000 --- a/account_invoice_accrual/models/res_company.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2023 ACSONE SA/NV -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class ResCompany(models.Model): - - _inherit = "res.company" - - dft_accrual_revenue_journal_id = fields.Many2one( - comodel_name="account.journal", string="Default Journal for Accrued Revenues" - ) - dft_accrual_expense_journal_id = fields.Many2one( - comodel_name="account.journal", string="Default Journal for Accrued Expenses" - ) diff --git a/account_invoice_accrual/wizards/__init__.py b/account_invoice_accrual/wizards/__init__.py index 0ccffb95ae1..8c20958590b 100644 --- a/account_invoice_accrual/wizards/__init__.py +++ b/account_invoice_accrual/wizards/__init__.py @@ -1,3 +1,2 @@ from . import account_move_accrue from . import account_move_reversal -from . import res_config_settings diff --git a/account_invoice_accrual/wizards/account_move_accrue.py b/account_invoice_accrual/wizards/account_move_accrue.py index 05d34224138..97e4e66635a 100644 --- a/account_invoice_accrual/wizards/account_move_accrue.py +++ b/account_invoice_accrual/wizards/account_move_accrue.py @@ -59,16 +59,7 @@ def _default_journal(self): and self.env.context["active_model"] == "account.move" ): inv = self.env["account.move"].browse(self.env.context["active_ids"])[0] - if inv.move_type in ("out_invoice", "out_refund"): - journal_id = ( - inv.company_id.dft_accrual_revenue_journal_id.id - or inv.company_id.default_cutoff_journal_id.id - ) - else: - journal_id = ( - inv.company_id.dft_accrual_expense_journal_id.id - or inv.company_id.default_cutoff_journal_id.id - ) + journal_id = inv.company_id.default_cutoff_journal_id.id return journal_id @api.model diff --git a/account_invoice_accrual/wizards/res_config_settings.py b/account_invoice_accrual/wizards/res_config_settings.py deleted file mode 100644 index 1757643fb16..00000000000 --- a/account_invoice_accrual/wizards/res_config_settings.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2023 ACSONE SA/NV -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class ResConfigSettings(models.TransientModel): - - _inherit = "res.config.settings" - - dft_accrual_revenue_journal_id = fields.Many2one( - related="company_id.dft_accrual_revenue_journal_id", readonly=False - ) - dft_accrual_expense_journal_id = fields.Many2one( - related="company_id.dft_accrual_expense_journal_id", readonly=False - ) diff --git a/account_invoice_accrual/wizards/res_config_settings.xml b/account_invoice_accrual/wizards/res_config_settings.xml deleted file mode 100644 index 8bdf4a2dbdc..00000000000 --- a/account_invoice_accrual/wizards/res_config_settings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - res.config.settings.form (in account_invoice_accrual) - res.config.settings - - - -
-
-
-
-
-
-
- - - -