From 3312657294947b1cc8670a0ed3557e12ee6969c8 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 30 Jun 2023 08:58:41 +0000 Subject: [PATCH] [FIX] hr_payroll_acccount: Make default account configurable on journal Purpose ======= 2 commits were making impossible to define a default account on a miscellaneous account journal. However, this is used in payroll to auto-balance unbalanced moves. After a discussion with the related team, it has been decided to revert both commits, which were breaking other use cases as well. Revert "[FIX] account: fix the domain of default_account_id from account_journal" This reverts commit b09f06f9863825defd6cff78832117af63119104. Revert "[IMP] account: remove default account on misc journal form view" This reverts commit f2c0bc321bd952a47dbd9b7dc7e4e988ba04ef0e. Part-of: odoo/odoo#124222 --- addons/account/models/account_journal.py | 2 +- addons/account/views/account_journal_views.xml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index 6520a567b35..6bc03de75bf 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -93,7 +93,7 @@ class AccountJournal(models.Model): comodel_name='account.account', check_company=True, copy=False, ondelete='restrict', string='Default Account', domain="[('deprecated', '=', False)," - "('account_type', '=', default_account_type), ('account_type', 'not in', ('asset_receivable', 'liability_payable'))]") + "'|', ('account_type', '=', default_account_type), ('account_type', 'not in', ('asset_receivable', 'liability_payable'))]") suspense_account_id = fields.Many2one( comodel_name='account.account', check_company=True, ondelete='restrict', readonly=False, store=True, compute='_compute_suspense_account_id', diff --git a/addons/account/views/account_journal_views.xml b/addons/account/views/account_journal_views.xml index deb155ab402..55e8671edc4 100644 --- a/addons/account/views/account_journal_views.xml +++ b/addons/account/views/account_journal_views.xml @@ -68,9 +68,12 @@ attrs="{'invisible': [('type', '!=', 'sale')]}" groups="account.group_account_readonly"/>