[IMP] account: Add the possiblity to filter and group by analytic accounts

PURPOSE
=======

Add the possibility to filter on analytic accounting in the invoices report

SPECIFICATION
=============

Accounting > Reporting > Invoices (Business Intelligence)

- Add filter / group by analytic account
- If possible, filter/group by visible only if "Analytic Account" group enabled in configuration
This commit is contained in:
Pragnesh Mistry
2017-07-07 17:10:48 +02:00
committed by Yannick Tivisse
parent d9b2045bcc
commit fdc13474e7
2 changed files with 3 additions and 0 deletions
@@ -66,6 +66,7 @@ class AccountInvoiceReport(models.Model):
residual = fields.Float(string='Due Amount', readonly=True)
user_currency_residual = fields.Float(string="Total Residual", compute='_compute_amounts_in_user_currency', digits=0)
country_id = fields.Many2one('res.country', string='Country of the Partner Company')
account_analytic_id = fields.Many2one('account.analytic.account', string='Analytic Account', groups="analytic.group_analytic_accounting")
_order = 'date desc'
@@ -85,6 +85,7 @@
<field name="partner_id" operator="child_of"/>
<field name="user_id" />
<field name="categ_id" filter_domain="[('categ_id', 'child_of', self)]"/>
<field name="account_analytic_id"/>
<group expand="1" string="Group By">
<filter string="Partner" name="partner_id" context="{'group_by':'partner_id','residual_visible':True}"/>
<filter string="Salesperson" name='user' context="{'group_by':'user_id'}"/>
@@ -94,6 +95,7 @@
<separator orientation="vertical" />
<filter string="Date" context="{'group_by':'date'}"/>
<filter string="Due Month" context="{'group_by':'date_due:month'}"/>
<filter string="Analytic Account" name="account_analytic_id" context="{'group_by':'account_analytic_id'}" groups="analytic.group_analytic_accounting" />
</group>
</search>
</field>