[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 <las@odoo.com>
This commit is contained in:
Camille Spiritus
2021-12-21 12:54:54 +00:00
committed by Laurent Smet
parent c0515b4585
commit fbb5b074f7
4 changed files with 11 additions and 4 deletions
+4
View File
@@ -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:
@@ -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')
@@ -97,6 +97,7 @@
<field name="internal_type" invisible="1"/>
<field name="internal_group" invisible="1"/>
<field name="reconcile" widget="boolean_toggle" attrs="{'invisible': ['|', ('internal_type','=','liquidity'), ('internal_group', '=', 'off_balance')]}"/>
<field name="non_trade" widget="boolean_toggle" attrs="{'invisible': [('internal_type', 'not in', ('payable','receivable'))]}"/>
<field name="tax_ids" optional="hide" widget="many2many_tags"/>
<field name="tag_ids" optional="hide" widget="many2many_tags"/>
<field name="allowed_journal_ids" optional="hide" widget="many2many_tags"/>
+5 -3
View File
@@ -362,8 +362,10 @@
<filter string="Cash" name="cash" domain="[('move_id.journal_id.type', '=', 'cash')]" context="{'default_journal_type': 'cash'}"/>
<filter string="Miscellaneous" domain="[('move_id.journal_id.type', '=', 'general')]" name="misc_filter" context="{'default_journal_type': 'general'}"/>
<separator/>
<filter string="Payable" domain="[('account_id.internal_type', '=', 'payable')]" help="From Payable accounts" name="payable"/>
<filter string="Receivable" domain="[('account_id.internal_type', '=', 'receivable')]" help="From Receivable accounts" name="receivable"/>
<filter string="Payable" domain="[('account_id.internal_type', '=', 'payable'), ('account_id.non_trade', '=', False)]" help="From Trade Payable accounts" name="trade_payable"/>
<filter string="Receivable" domain="[('account_id.internal_type', '=', 'receivable'), ('account_id.non_trade', '=', False)]" help="From Trade Receivable accounts" name="trade_receivable"/>
<filter string="Non Trade Payable" domain="[('account_id.internal_type', '=', 'payable'), ('account_id.non_trade', '=', True)]" help="From Non Trade Receivable accounts" name="non_trade_payable"/>
<filter string="Non Trade Receivable" domain="[('account_id.internal_type', '=', 'receivable'), ('account_id.non_trade', '=', True)]" help="From Non Trade Receivable accounts" name="non_trade_receivable"/>
<separator/>
<filter string="Date" name="date" date="date"/>
<separator/>
@@ -1433,7 +1435,7 @@
</record>
<record id="action_account_moves_ledger_partner" model="ir.actions.act_window">
<field name="context">{'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}</field>
<field name="context">{'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}</field>
<field name="name">Partner Ledger</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>