[IMP]:hr_timesheet_invoice:Improved SQL view report.(Timesheet Line)
bzr revid: apa@tinyerp.com-20100422061309-hjcrf1opyj2b636v
This commit is contained in:
parent
f35c91b63f
commit
8d24e5db50
|
@ -29,7 +29,8 @@ class report_timesheet_line(osv.osv):
|
|||
_columns = {
|
||||
'name': fields.char('Year',size=64,required=False, readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'day' : fields.date('Day', readonly=True),
|
||||
'date' : fields.date('Date', readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'quantity': fields.float('Quantity', readonly=True),
|
||||
'cost': fields.float('Cost', readonly=True),
|
||||
'product_id' : fields.many2one('product.product', 'Product',readonly=True),
|
||||
|
@ -46,10 +47,11 @@ class report_timesheet_line(osv.osv):
|
|||
create or replace view report_timesheet_line as (
|
||||
select
|
||||
min(l.id) as id,
|
||||
l.date as date,
|
||||
to_char(l.date,'YYYY') as name,
|
||||
to_char(l.date,'MM') as month,
|
||||
l.user_id,
|
||||
l.date as day,
|
||||
to_char(l.date, 'YYYY-MM-DD') as day,
|
||||
l.invoice_id,
|
||||
l.product_id,
|
||||
l.account_id,
|
||||
|
@ -62,8 +64,6 @@ class report_timesheet_line(osv.osv):
|
|||
l.user_id is not null
|
||||
group by
|
||||
l.date,
|
||||
to_char(l.date,'YYYY'),
|
||||
to_char(l.date,'MM'),
|
||||
l.user_id,
|
||||
l.product_id,
|
||||
l.account_id,
|
||||
|
|
|
@ -26,10 +26,11 @@
|
|||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Timesheet Line">
|
||||
<field name="day"/>
|
||||
<field name="quantity"/>
|
||||
<field name="cost"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="quantity" sum="Quantity"/>
|
||||
<field name="cost" sum="Cost"/>
|
||||
<field name="user_id" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="account_id" invisible="1"/>
|
||||
|
@ -46,19 +47,42 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Timesheet by user">
|
||||
<group col="10" colspan="4">
|
||||
<filter icon="terp-hr" string="This Year" domain="[('name','=',time.strftime('%%Y'))]" help="Timesheet by user in this year"/>
|
||||
<filter icon="terp-hr" string="This Month" domain="[('month','=',time.strftime('%%m'))]" help="Timesheet by user in this month"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-hr"
|
||||
string="My Timesheet Line"
|
||||
domain="[('user_id','=',uid)]"/></field>
|
||||
<field name="account_id"/>
|
||||
<filter icon="terp-hr" string="This Year"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Timesheet lines in this year"/>
|
||||
<filter icon="terp-hr" string="This Month"
|
||||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Timesheet lines in this month"/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days "
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Timesheet lines during last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="user_id" widget="selection">
|
||||
<filter icon="terp-hr"
|
||||
string="My timesheet lines"
|
||||
help = "My timesheet lines"
|
||||
domain="[('user_id','=',uid)]" />
|
||||
<filter icon="terp-hr"
|
||||
string="Non Assigned timesheets to users"
|
||||
help="Non Assigned timesheets to users"
|
||||
domain="[('user_id','=',False)]"/>
|
||||
</field>
|
||||
<field name="account_id"/>
|
||||
<field name="product_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Extended options..." colspan="10" col="12">
|
||||
<field name="date"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="invoice_id" widget="selection"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="10" col="12">
|
||||
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Account" icon="terp-hr" context="{'group_by':'account_id'}"/>
|
||||
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Invoice" icon="terp-hr" context="{'group_by':'invoice_id'}"/>
|
||||
|
@ -76,7 +100,7 @@
|
|||
<field name="res_model">report.timesheet.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,graph</field>
|
||||
<field name="context">{'search_default_User': 1}</field>
|
||||
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
|
||||
<field name="search_view_id" ref="view_timesheet_line_search"/>
|
||||
</record>
|
||||
<menuitem action="action_timesheet_line_stat_all" id="menu_report_timesheet_line_all" parent="hr.menu_hr_reporting"/>
|
||||
|
|
Loading…
Reference in New Issue