[IMP] improves the reporting views in account module (work on the Pivot tables, and remove some useless day/month/year attributes) (addon account)
bzr revid: ged@openerp.com-20140129160348-230nvcutbdqh1hx1
This commit is contained in:
parent
906f28109c
commit
4b3076e955
|
@ -28,11 +28,6 @@ class analytic_entries_report(osv.osv):
|
|||
_auto = False
|
||||
_columns = {
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'User',readonly=True),
|
||||
'name': fields.char('Description', size=64, readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner'),
|
||||
|
@ -56,9 +51,6 @@ class analytic_entries_report(osv.osv):
|
|||
min(a.id) as id,
|
||||
count(distinct a.id) as nbr,
|
||||
a.date as date,
|
||||
to_char(a.date, 'YYYY') as year,
|
||||
to_char(a.date, 'MM') as month,
|
||||
to_char(a.date, 'YYYY-MM-DD') as day,
|
||||
a.user_id as user_id,
|
||||
a.name as name,
|
||||
analytic.partner_id as partner_id,
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<field name="model">analytic.entries.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Analytic Entries Analysis">
|
||||
<field name="day" string="Day"/>
|
||||
<field name="date"/>
|
||||
<filter string="My Entries" icon="terp-personal" domain="[('user_id','=',uid)]" help="My Entries"/>
|
||||
<field name="account_id" groups="analytic.group_analytic_accounting"/>
|
||||
|
@ -21,9 +20,9 @@
|
|||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Product Unit of Measure" icon="terp-mrp" context="{'group_by':'product_uom_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" name="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
<filter string="Date (day)" icon="terp-go-today" context="{'group_by':'date:day'}"/>
|
||||
<filter string="Date (month)" name="Month" icon="terp-go-month" context="{'group_by':'date:month'}"/>
|
||||
<filter string="Date (year)" icon="terp-go-year" context="{'group_by':'date:year'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
@ -34,8 +33,9 @@
|
|||
<field name="arch" type="xml">
|
||||
<graph string="Analytic Entries Analysis" type="pivot">
|
||||
<field name="user_id" type="row"/>
|
||||
<field name="unit_amount" operator="+"/>
|
||||
<field name="amount" operator="+"/>
|
||||
<field name="nbr" type="measure"/>
|
||||
<field name="unit_amount" type="measure"/>
|
||||
<field name="amount" type="measure"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -55,11 +55,6 @@ class account_invoice_report(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'month': fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
|
||||
'product_id': fields.many2one('product.product', 'Product', readonly=True),
|
||||
'product_qty':fields.float('Qty', readonly=True),
|
||||
'uom_name': fields.char('Reference Unit of Measure', size=128, readonly=True),
|
||||
|
@ -105,7 +100,7 @@ class account_invoice_report(osv.osv):
|
|||
|
||||
def _select(self):
|
||||
select_str = """
|
||||
SELECT sub.id, sub.date, sub.year, sub.month, sub.day, sub.product_id, sub.partner_id, sub.country_id,
|
||||
SELECT sub.id, sub.date, sub.product_id, sub.partner_id, sub.country_id,
|
||||
sub.payment_term, sub.period_id, sub.uom_name, sub.currency_id, sub.journal_id,
|
||||
sub.fiscal_position, sub.user_id, sub.company_id, sub.nbr, sub.type, sub.state,
|
||||
sub.categ_id, sub.date_due, sub.account_id, sub.account_line_id, sub.partner_bank_id,
|
||||
|
@ -118,9 +113,6 @@ class account_invoice_report(osv.osv):
|
|||
select_str = """
|
||||
SELECT min(ail.id) AS id,
|
||||
ai.date_invoice AS date,
|
||||
to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text) AS year,
|
||||
to_char(ai.date_invoice::timestamp with time zone, 'MM'::text) AS month,
|
||||
to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text) AS day,
|
||||
ail.product_id, ai.partner_id, ai.payment_term, ai.period_id,
|
||||
CASE
|
||||
WHEN u.uom_type::text <> 'reference'::text
|
||||
|
@ -192,9 +184,6 @@ class account_invoice_report(osv.osv):
|
|||
def _group_by(self):
|
||||
group_by_str = """
|
||||
GROUP BY ail.product_id, ai.date_invoice, ai.id,
|
||||
to_char(ai.date_invoice::timestamp with time zone, 'YYYY'::text),
|
||||
to_char(ai.date_invoice::timestamp with time zone, 'MM'::text),
|
||||
to_char(ai.date_invoice::timestamp with time zone, 'YYYY-MM-DD'::text),
|
||||
ai.partner_id, ai.payment_term, ai.period_id, u.name, ai.currency_id, ai.journal_id,
|
||||
ai.fiscal_position, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id,
|
||||
ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual,
|
||||
|
|
|
@ -6,8 +6,10 @@
|
|||
<field name="model">account.invoice.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Invoices Analysis" type="pivot">
|
||||
<field name="period_id" type="row"/>
|
||||
<field name="categ_id" type="row"/>
|
||||
<field name="period_id" type="col"/>
|
||||
<field name="nbr" type="measure"/>
|
||||
<field name="product_qty" type="measure"/>
|
||||
<field name="price_total" type="measure"/>
|
||||
</graph>
|
||||
</field>
|
||||
|
@ -47,9 +49,9 @@
|
|||
<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
|
||||
<filter string="Account" icon="terp-folder-orange" context="{'group_by':'account_line_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
<filter string="Day" name="day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by Invoice Date"/>
|
||||
<filter string="Month" name="month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of Invoice Date"/>
|
||||
<filter string="Year" name="group_year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of Invoice Date"/>
|
||||
<filter string="Invoice Date (day)" name="day" icon="terp-go-today" context="{'group_by':'date:day'}" help="Group by Invoice Date"/>
|
||||
<filter string="Invoice Date (month)" name="month" icon="terp-go-month" context="{'group_by':'date:month'}" help="Group by month of Invoice Date"/>
|
||||
<filter string="Invoice Date (year)" name="group_year" icon="terp-go-year" context="{'group_by':'date:year'}" help="Group by year of Invoice Date"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
<field name="arch" type="xml">
|
||||
<graph string="Treasury Analysis" type="pivot">
|
||||
<field name="period_id" type="row"/>
|
||||
<field name="debit" type="measure"/>
|
||||
<field name="credit" type="measure"/>
|
||||
<field name="balance" type="measure"/>
|
||||
</graph>
|
||||
</field>
|
||||
|
|
Loading…
Reference in New Issue