Browse Source

add search view and default group by

pull/367/head
Simone Orsi 9 years ago
committed by Jordi Ballester
parent
commit
d9f7c50852
  1. 26
      account_financial_report_qweb/wizard/general_ledger_wizard.xml
  2. 5
      account_financial_report_qweb/wizard/ledger_report_wizard.py

26
account_financial_report_qweb/wizard/general_ledger_wizard.xml

@ -41,7 +41,7 @@
<record id="ledger_report_wizard_line_tree_view" <record id="ledger_report_wizard_line_tree_view"
model="ir.ui.view"> model="ir.ui.view">
<field name="name">General Ledger Line</field>
<field name="name">General Ledger Line tree</field>
<field name="model">ledger.report.wizard.line</field> <field name="model">ledger.report.wizard.line</field>
<field name="type">tree</field> <field name="type">tree</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
@ -59,6 +59,30 @@
</field> </field>
</record> </record>
<record id="ledger_report_wizard_line_search_view"
model="ir.ui.view">
<field name="name">General Ledger Line search</field>
<field name="model">ledger.report.wizard.line</field>
<field name="arch" type="xml">
<search string="Line search">
<group expand="1" string="Group By">
<filter
name="group_by_account_id"
string="Account"
domain="[]"
context="{'group_by' : 'account_id'}"
/>
<filter
name="group_by_date"
string="Month"
domain="[]"
context="{'group_by' : 'date:month'}"
/>
</group>
</search>
</field>
</record>
<record id="action_ledger_report_wizard" model="ir.actions.act_window"> <record id="action_ledger_report_wizard" model="ir.actions.act_window">
<field name="name">General Ledger</field> <field name="name">General Ledger</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>

5
account_financial_report_qweb/wizard/ledger_report_wizard.py

@ -143,7 +143,10 @@ class LedgerReportWizard(models.TransientModel):
'view_mode': 'tree', 'view_mode': 'tree',
'res_model': 'ledger.report.wizard.line', 'res_model': 'ledger.report.wizard.line',
'view_id': False, 'view_id': False,
'context': {'group_by': ['account_id', 'date:month']},
'context': {
'search_default_group_by_account_id': True,
'search_default_group_by_date': True,
},
'type': 'ir.actions.act_window' 'type': 'ir.actions.act_window'
} }

Loading…
Cancel
Save