diff --git a/addons/account/models/account_journal.py b/addons/account/models/account_journal.py index e1c59385f0d..0d7401ee493 100644 --- a/addons/account/models/account_journal.py +++ b/addons/account/models/account_journal.py @@ -92,7 +92,6 @@ class AccountJournal(models.Model): help="Bank statements transactions will be posted on the suspense account until the final reconciliation " "allowing finding the right account.", string='Suspense Account', domain="[('deprecated', '=', False), ('company_id', '=', company_id), \ - ('account_type', 'not in', ('asset_receivable', 'liability_payable')), \ ('account_type', '=', 'asset_current')]") restrict_mode_hash_table = fields.Boolean(string="Lock Posted Entries with Hash", help="If ticked, the accounting entry or invoice receives a hash as soon as it is posted and cannot be modified anymore.") @@ -149,14 +148,12 @@ class AccountJournal(models.Model): help="Used to register a profit when the ending balance of a cash register differs from what the system computes", string='Profit Account', domain="[('deprecated', '=', False), ('company_id', '=', company_id), \ - ('account_type', 'not in', ('asset_receivable', 'liability_payable')), \ ('account_type', 'in', ('income', 'income_other'))]") loss_account_id = fields.Many2one( comodel_name='account.account', check_company=True, help="Used to register a loss when the ending balance of a cash register differs from what the system computes", string='Loss Account', domain="[('deprecated', '=', False), ('company_id', '=', company_id), \ - ('account_type', 'not in', ('asset_receivable', 'liability_payable')), \ ('account_type', '=', 'expense')]") # Bank journals fields diff --git a/addons/account/models/company.py b/addons/account/models/company.py index 28b83175819..4c71924a013 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -83,12 +83,12 @@ class ResCompany(models.Model): income_currency_exchange_account_id = fields.Many2one( comodel_name='account.account', string="Gain Exchange Rate Account", - domain="[('account_type', 'not in', ('asset_receivable','liability_payable','asset_cash', 'liability_credit_card')), ('deprecated', '=', False), ('company_id', '=', id), \ + domain="[('deprecated', '=', False), ('company_id', '=', id), \ ('account_type', 'in', ('income', 'income_other'))]") expense_currency_exchange_account_id = fields.Many2one( comodel_name='account.account', string="Loss Exchange Rate Account", - domain="[('account_type', 'not in', ('asset_receivable','liability_payable','asset_cash', 'liability_credit_card')), ('deprecated', '=', False), ('company_id', '=', id), \ + domain="[('deprecated', '=', False), ('company_id', '=', id), \ ('account_type', '=', 'expense')]") anglo_saxon_accounting = fields.Boolean(string="Use anglo-saxon accounting") property_stock_account_input_categ_id = fields.Many2one('account.account', string="Input Account for Stock Valuation") diff --git a/addons/account/models/res_config_settings.py b/addons/account/models/res_config_settings.py index 8163ca337fb..e686fc46a23 100644 --- a/addons/account/models/res_config_settings.py +++ b/addons/account/models/res_config_settings.py @@ -21,14 +21,14 @@ class ResConfigSettings(models.TransientModel): related="company_id.income_currency_exchange_account_id", string="Gain Account", readonly=False, - domain="[('account_type', 'not in', ('asset_receivable','liability_payable','asset_cash','liability_credit_card')), ('deprecated', '=', False), ('company_id', '=', company_id),\ + domain="[('deprecated', '=', False), ('company_id', '=', company_id),\ ('account_type', 'in', ('income', 'income_other'))]") expense_currency_exchange_account_id = fields.Many2one( comodel_name="account.account", related="company_id.expense_currency_exchange_account_id", string="Loss Account", readonly=False, - domain="[('account_type', 'not in', ('asset_receivable','liability_payable','asset_cash','liability_credit_card')), ('deprecated', '=', False), ('company_id', '=', company_id),\ + domain="[('deprecated', '=', False), ('company_id', '=', company_id),\ ('account_type', '=', 'expense')]") has_chart_of_accounts = fields.Boolean(compute='_compute_has_chart_of_accounts', string='Company has a chart of accounts') chart_template_id = fields.Many2one('account.chart.template', string='Template', default=lambda self: self.env.company.chart_template_id, @@ -42,7 +42,7 @@ class ResConfigSettings(models.TransientModel): string='Bank Suspense Account', readonly=False, related='company_id.account_journal_suspense_account_id', - domain="[('deprecated', '=', False), ('company_id', '=', company_id), ('account_type', 'not in', ('asset_receivable', 'liability_payable')), ('account_type', 'in', ('asset_current', 'liability_current'))]", + domain="[('deprecated', '=', False), ('company_id', '=', company_id), ('account_type', 'in', ('asset_current', 'liability_current'))]", help='Bank Transactions are posted immediately after import or synchronization. ' 'Their counterparty is the bank suspense account.\n' 'Reconciliation replaces the latter by the definitive account(s).') @@ -51,7 +51,7 @@ class ResConfigSettings(models.TransientModel): string='Outstanding Receipts Account', readonly=False, related='company_id.account_journal_payment_debit_account_id', - domain="[('deprecated', '=', False), ('company_id', '=', company_id), ('account_type', 'not in', ('asset_receivable', 'liability_payable')), ('account_type', '=', 'asset_current')]", + domain="[('deprecated', '=', False), ('company_id', '=', company_id), ('account_type', '=', 'asset_current')]", help='Incoming payments are posted on an Outstanding Receipts Account. ' 'In the bank reconciliation widget, they appear as blue lines.\n' 'Bank transactions are then reconciled on the Outstanding Receipts Accounts rather than the Receivable ' @@ -61,7 +61,7 @@ class ResConfigSettings(models.TransientModel): string='Outstanding Payments Account', readonly=False, related='company_id.account_journal_payment_credit_account_id', - domain="[('deprecated', '=', False), ('company_id', '=', company_id), ('account_type', 'not in', ('asset_receivable', 'liability_payable')), ('account_type', '=', 'asset_current')]", + domain="[('deprecated', '=', False), ('company_id', '=', company_id), ('account_type', '=', 'asset_current')]", help='Outgoing Payments are posted on an Outstanding Payments Account. ' 'In the bank reconciliation widget, they appear as blue lines.\n' 'Bank transactions are then reconciled on the Outstanding Payments Account rather the Payable Account.')