Skip to content
Permalink
Browse files

[FIX] account: expand by default account move lines tree view

The commit c429c0e removed context keys that were used to expand the view in some cases here: https://github.com/odoo/odoo/blob/c429c0e0bd1208694623d5567682c43f9f0e51b7/addons/account/views/account_move_views.xml#L162. This commit adds a new context key, clearer than the previous one.
Also, the commit bc131c0 duplicated some actions. We remove them here too.

closes #35653

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
  • Loading branch information...
william-andre committed Aug 12, 2019
1 parent 0f6740c commit 98a55917a602c0c47093b4270ebc4e8b416ecf32
Showing with 5 additions and 40 deletions.
  1. +5 −40 addons/account/views/account_move_views.xml
@@ -159,7 +159,7 @@
<field name="model">account.move.line</field>
<field eval="1" name="priority"/>
<field name="arch" type="xml">
<tree string="Journal Items" create="false" editable="bottom" expand="context.get('group_by') in ('move_id', 'account_id') and 1 or 0">
<tree string="Journal Items" create="false" editable="bottom" expand="context.get('expand', False)">
<field name="date" optional="show" attrs="{'readonly':[('parent_state','=','posted')]}"/>
<field name="ref" optional="hide"/>
<field name="move_id" optional="show" readonly="1"/>
@@ -959,7 +959,7 @@
</record>

<record id="action_account_moves_journal_sales" model="ir.actions.act_window">
<field name="context">{'journal_type':'sales', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_sales':1, 'name_groupby':1}</field>
<field name="context">{'journal_type':'sales', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_sales':1, 'name_groupby':1, 'expand': 1}</field>
<field name="name">Sales</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
@@ -968,7 +968,7 @@
</record>

<record id="action_account_moves_journal_purchase" model="ir.actions.act_window">
<field name="context">{'journal_type':'purchase', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_purchases':1, 'name_groupby':1}</field>
<field name="context">{'journal_type':'purchase', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_purchases':1, 'name_groupby':1, 'expand': 1}</field>
<field name="name">Purchase</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
@@ -977,7 +977,7 @@
</record>

<record id="action_account_moves_journal_bank_cash" model="ir.actions.act_window">
<field name="context">{'journal_type':'bank', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_bank':1, 'search_default_cash':1, 'name_groupby':1}</field>
<field name="context">{'journal_type':'bank', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_bank':1, 'search_default_cash':1, 'name_groupby':1, 'expand': 1}</field>
<field name="name">Bank and Cash</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
@@ -986,7 +986,7 @@
</record>

<record id="action_account_moves_journal_misc" model="ir.actions.act_window">
<field name="context">{'journal_type':'general', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_misc_filter':1, 'name_groupby':1}</field>
<field name="context">{'journal_type':'general', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_misc_filter':1, 'name_groupby':1, 'expand': 1}</field>
<field name="name">Miscellaneous</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
@@ -1012,41 +1012,6 @@
<field name="view_mode">tree,pivot,graph,form,kanban</field>
</record>

<record id="action_account_moves_journal_bank_cash" model="ir.actions.act_window">
<field name="context">{'journal_type':'bank', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_bank':1, 'search_default_cash':1, 'name_groupby':1}</field>
<field name="name">Bank and Cash</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
<field name="view_id" ref="view_move_line_tree_grouped_bank_cash"/>
<field name="view_mode">tree,pivot,graph,form,kanban</field>
</record>

<record id="action_account_moves_journal_misc" model="ir.actions.act_window">
<field name="context">{'journal_type':'general', 'search_default_group_by_move': 1, 'search_default_posted':1, 'search_default_misc_filter':1, 'name_groupby':1}</field>
<field name="name">Miscellaneous</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
<field name="view_id" ref="view_move_line_tree_grouped_misc"/>
<field name="view_mode">tree,pivot,graph,form,kanban</field>
</record>

<record id="action_account_moves_ledger_general" model="ir.actions.act_window">
<field name="context">{'journal_type':'general', 'search_default_group_by_account': 1, 'search_default_posted':1}</field>
<field name="name">General Ledger</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
<field name="view_id" ref="view_move_line_tree_grouped_general"/>
<field name="view_mode">tree,pivot,graph,form,kanban</field>
</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="name">Partner Ledger</field>
<field name="res_model">account.move.line</field>
<field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
<field name="view_id" ref="view_move_line_tree_grouped_partner"/>
</record>

<record id="action_account_moves_all_tree" model="ir.actions.act_window">
<field name="name">Journal Items</field>
<field name="res_model">account.move.line</field>

0 comments on commit 98a5591

Please sign in to comment.
You can’t perform that action at this time.