[IMP] add default on searchviews

bzr revid: nel@tinyerp.com-20100415130142-d7b56nqfzfwnek3t
This commit is contained in:
nel@tinyerp.com
2010-04-15 15:01:42 +02:00
3 changed files with 18 additions and 19 deletions
@@ -84,7 +84,7 @@
<filter string="Picking" icon="terp-mrp" context="{'group_by':'picking_id'}"/>
<separator orientation="vertical"/>
<filter string="Routing" icon="terp-mrp" context="{'group_by':'routing_id'}"/>
<filter string="Product" icon="terp-mrp" context="{'group_by':'product_id'}" default = "1"/>
<filter string="Product" name="Product" icon="terp-mrp" context="{'group_by':'product_id'}" />
<filter string="State" icon="terp-mrp" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="BOM" icon="terp-mrp" context="{'group_by':'bom_id'}"/>
@@ -101,6 +101,8 @@
<field name="view_mode">tree,graph</field>
<field name="view_id" ref="view_report_mrp_production_order_tree"/>
<field name="search_view_id" ref="view_report_mrp_production_order_filter"/>
<field name="context">{'search_default_Product': 1}</field>
</record>
<record model="ir.actions.act_window.view" id="action_report_mrp_production_order_tree">
+13 -17
View File
@@ -124,23 +124,19 @@ class project_vs_remaining_hours(osv.osv):
tools.sql.drop_view_if_exists(cr, 'project_vs_remaining_hours')
cr.execute("""
create or replace view project_vs_remaining_hours as (
select
min(pt.id) as id,
a.name as project,
sum(pt.remaining_hours) as remaining_hours,
a.state,
pu.uid
from
project_task as pt,
project_project as p,
account_analytic_account as a,
project_user_rel as pu
where
pt.project_id=p.id and
p.category_id = a.id and
pu.project_id=p.id
group by
a.name,a.state,pu.uid
select
min(pt.id) as id,
aaa.name as project,
CASE WHEN pu.uid is null
THEN aaa.user_id ELSE pu.uid END as uid,
sum(pt.remaining_hours) as remaining_hours,
aaa.state
from project_task pt
left join project_project as pp ON (pt.project_id=pp.id)
left join account_analytic_account as aaa ON (pp.category_id=aaa.id)
left join project_user_rel as pu ON (pu.project_id=pp.id)
where pt.create_uid=aaa.user_id
group by aaa.name,aaa.state,pu.uid,aaa.user_id
)
""")
project_vs_remaining_hours()
@@ -85,7 +85,7 @@
<newline/>
<group expand="1" string="Group By..." colspan="4" col="5">
<filter string="Partner" icon="terp-stock" domain="[]" context="{'group_by':'address_id'}"/>
<filter string="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
<filter string="State" name="State" icon="terp-stock" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Month" icon="terp-sale" domain="[]" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-sale" domain="[]" context="{'group_by':'name'}"/>
@@ -100,6 +100,7 @@
<field name="view_mode">tree,graph</field>
<field name="view_id" ref="view_report_report_stock_picking_tree"/>
<field name="search_view_id" ref="view_report_report_stock_picking_filter"/>
<field name="context">{'search_default_State': 1}</field>
</record>
<record model="ir.actions.act_window.view" id="action_report_report_stock_picking_tree">