[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 b09f06f986.

Revert "[IMP] account: remove default account on misc journal form view"
This reverts commit f2c0bc321b.

Part-of: odoo/odoo#124222
This commit is contained in:
Yannick Tivisse
2023-08-17 10:32:52 +02:00
parent d0e2d1365c
commit 3312657294
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -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',
@@ -68,9 +68,12 @@
attrs="{'invisible': [('type', '!=', 'sale')]}" groups="account.group_account_readonly"/>
<label for="default_account_id" string="Default Expense Account"
attrs="{'invisible': [('type', '!=', 'purchase')]}" groups="account.group_account_readonly"/>
<label for="default_account_id" string="Default Account"
help="If set, this account is used to automatically balance entries."
attrs="{'invisible': [('type', '!=', 'general')]}" groups="account.group_account_readonly"/>
<field name="default_account_id" nolabel="1"
attrs="{'required': ['|', '&amp;', ('id', '!=', False), ('type', 'in', ('bank', 'cash')), ('type', 'in', ('sale', 'purchase'))],
'invisible': [('type', 'in', (False, 'general'))]}"
'invisible': [('type', '=', False)]}"
options="{'no_quick_create': True}"
groups="account.group_account_readonly"/>
<field name="suspense_account_id"