From fbb5b074f74a7a7f7c0e21d34b669857db92cc77 Mon Sep 17 00:00:00 2001 From: Camille Spiritus Date: Thu, 4 Nov 2021 14:46:14 +0000 Subject: [PATCH] [IMP] account: rename non-trade filtering option, spread its use Renamed the 'Other' account type into 'Non Trade' to enhance clarity and coherence Changed the filtering system in the accounting search view to improve coherence with the filtering system available in the reports. It is now possible to filter the trade/non trade accounts in the accounting views. This change may be overriden by default selections already in place. Renaming Receivable/Payable to Trade Receivable/Trade Payable could have turned out to be confusing for accustomed users. They are now renamed Receivable/Payable, though the Non-Trade option is still present. task-2669128 closes odoo/odoo#79752 Related: odoo/enterprise#21773 Related: odoo/upgrade#3004 Signed-off-by: Laurent Smet --- addons/account/models/account_account.py | 4 ++++ addons/account/tests/test_templates_consistency.py | 2 +- addons/account/views/account_account_views.xml | 1 + addons/account/views/account_move_views.xml | 8 +++++--- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_account.py b/addons/account/models/account_account.py index 0d83310eb90..9b4aed8d787 100644 --- a/addons/account/models/account_account.py +++ b/addons/account/models/account_account.py @@ -95,6 +95,10 @@ class AccountAccount(models.Model): ('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !') ] + non_trade = fields.Boolean(default=False, + help="If set, this account will belong to Non Trade Receivable/Payable in reports and filters.\n" + "If not, this account will belong to Trade Receivable/Payable in reports and filters.") + @api.constrains('reconcile', 'internal_group', 'tax_ids') def _constrains_reconcile(self): for record in self: diff --git a/addons/account/tests/test_templates_consistency.py b/addons/account/tests/test_templates_consistency.py index ce51e7db6d1..32f1b4c87c3 100644 --- a/addons/account/tests/test_templates_consistency.py +++ b/addons/account/tests/test_templates_consistency.py @@ -40,7 +40,7 @@ class AccountingTestTemplConsistency(TransactionCase): self.check_fields_consistency( 'account.account.template', 'account.account', exceptions=['chart_template_id', 'nocreate']) self.check_fields_consistency( - 'account.account', 'account.account.template', exceptions=['company_id', 'deprecated', 'opening_debit', 'opening_credit', 'allowed_journal_ids', 'group_id', 'root_id', 'is_off_balance']) + 'account.account', 'account.account.template', exceptions=['company_id', 'deprecated', 'opening_debit', 'opening_credit', 'allowed_journal_ids', 'group_id', 'root_id', 'is_off_balance', 'non_trade']) def test_account_tax_fields(self): '''Test fields consistency for ('account.tax', 'account.tax.template') diff --git a/addons/account/views/account_account_views.xml b/addons/account/views/account_account_views.xml index 49d826c320b..cbfbccbffc3 100644 --- a/addons/account/views/account_account_views.xml +++ b/addons/account/views/account_account_views.xml @@ -97,6 +97,7 @@ + diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 97a1a9da2b8..35cbb4d1f7d 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -362,8 +362,10 @@ - - + + + + @@ -1433,7 +1435,7 @@ - {'journal_type':'general', 'search_default_group_by_partner': 1, 'search_default_posted':1, 'search_default_payable':1, 'search_default_receivable':1, 'search_default_unreconciled':1} + {'journal_type':'general', 'search_default_group_by_partner': 1, 'search_default_posted':1, 'search_default_trade_payable':1, 'search_default_trade_receivable':1, 'search_default_unreconciled':1} Partner Ledger account.move.line [('display_type', 'not in', ('line_section', 'line_note'))]