[IMP] account: Add remaining columns to report

bzr revid: nel@tinyerp.com-20100504070536-hn3cx0dpjgn8tig8
This commit is contained in:
nel@tinyerp.com
2010-05-04 09:05:36 +02:00
parent 7dccf4fa5e
commit c974568121
2 changed files with 23 additions and 10 deletions
@@ -46,8 +46,11 @@ class account_entries_report(osv.osv):
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'state': fields.selection([('draft','Draft'), ('posted','Posted')], 'State',readonly=True,
help='When new account move is created the state will be \'Draft\'. When all the payments are done it will be in \'Posted\' state.'),
'state_2': fields.selection([('draft','Draft'), ('valid','Valid')], 'State of Move Line', readonly=True,
help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'),
'partner_id': fields.many2one('res.partner','Partner', readonly=True),
'period_id2': fields.many2one('account.period', 'Move Line Period', readonly=True),
'analytic_account_id' : fields.many2one('account.analytic.account', 'Analytic Account', readonly=True),
'journal_id2': fields.many2one('account.journal', 'Move Line Journal', readonly=True),
'type': fields.selection([
('pay_voucher','Cash Payment'),
@@ -59,6 +62,7 @@ class account_entries_report(osv.osv):
('journal_pur_voucher','Journal Purchase'),
('journal_voucher','Journal Voucher'),
],'Type',readonly=True),
'quantity': fields.float('Products Quantity', digits=(16,2), readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
}
_order = 'date desc'
@@ -70,7 +74,9 @@ class account_entries_report(osv.osv):
select
min(l.id) as id,
am.ref as ref,
sum(l.quantity) as quantity,
am.state as state,
l.state as state_2,
am.date as date,
count(l.id) as nbr,
count(distinct am.id) as nbl,
@@ -80,6 +86,7 @@ class account_entries_report(osv.osv):
to_char(am.date, 'YYYY-MM-DD') as day,
am.company_id as company_id,
l.account_id as account_id,
l.analytic_account_id as analytic_account_id,
l.date_created as date_created,
l.date_maturity as date_maturity,
am.journal_id as journal_id,
@@ -103,10 +110,12 @@ class account_entries_report(osv.osv):
l.period_id,
am.type,
l.partner_id,
l.analytic_account_id,
l.product_id,
l.date_created,
l.date_maturity,
l.account_id,
l.state,
l.debit
)
""")
@@ -12,21 +12,23 @@
<field name="date_maturity" invisible="1"/>
<field name="ref" invisible="1"/>
<field name="state" invisible="1"/>
<field name="state_2" invisible="1"/>
<field name="year" invisible="1"/>
<field name="day" invisible="1"/>
<field name="month" invisible="1"/>
<field name="nbr" sum="# of Entries "/>
<field name="nbl" sum="# of Lines "/>
<field name="amount" sum="# of Amount "/>
<field name="partner_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
<field name="journal_id" invisible="1"/>
<field name="journal_id2" invisible="1"/>
<field name="account_id" invisible="1"/>
<field name="analytic_account_id" invisible="1"/>
<field name="period_id" invisible="1"/>
<field name="period_id2" invisible="1"/>
<field name="type" invisible="1"/>
<field name="nbr" sum="# of Entries "/>
<field name="nbl" sum="# of Lines "/>
<field name="amount" sum="# of Amount "/>
<field name="quantity" sum="# of Products Qty "/>
</tree>
</field>
</record>
@@ -47,7 +49,7 @@
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Entries">
<group>
<group colspan="10" col="12">
<filter icon="terp-account" string="This Year"
domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
help="Entries of the year"/>
@@ -67,9 +69,8 @@
help = "Draft tasks"/>
<separator orientation="vertical"/>
<field name="journal_id" widget="selection"/>
<field name="journal_id2" widget="selection"/>
<field name="account_id"/>
<field name="company_id" widget="selection"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="partner_id" />
</group>
<newline/>
@@ -78,11 +79,13 @@
icon="terp-account"
domain="[('state','=','posted')]"
help = "Posted tasks"/>
<field name="state_2"/>
<separator orientation="vertical"/>
<field name="period_id" widget="selection"/>
<field name="period_id2" widget="selection"/>
<field name="type"/>
<field name="product_id" />
<field name="analytic_account_id"/>
<newline/>
<separator orientation="vertical"/>
<field name="date"/>
@@ -92,13 +95,14 @@
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Journal" name="Journal" icon="terp-account" context="{'group_by':'journal_id'}"/>
<filter string="Journal of Move Line" icon="terp-account" context="{'group_by':'journal_id2'}"/>
<filter string="Account" name="Account" icon="terp-account" context="{'group_by':'account_id'}"/>
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" />
<filter string="Analytic Account" name="Analytic Account" icon="terp-account" context="{'group_by':'analytic_account_id'}"/>
<filter string="Company" icon="terp-account" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<filter string="Partner" icon="terp-account" context="{'group_by':'partner_id'}"/>
<filter string="Product" icon="terp-account" context="{'group_by':'product_id'}"/>
<separator orientation="vertical"/>
<filter string="State" icon="terp-account" context="{'group_by':'state'}"/>
<filter string="State of Move Line" icon="terp-account" context="{'group_by':'state_2'}"/>
<filter string="Period" icon="terp-account" context="{'group_by':'period_id'}"/>
<filter string="Period of Move Line" icon="terp-account" context="{'group_by':'period_id2'}"/>
<filter string="Type" icon="terp-account" context="{'group_by':'type'}"/>