[IMP] improves the Work Order Analysis reporting view, removes old Day, Month, Year field from the postgres view (addon mrp_operations)

bzr revid: ged@openerp.com-20140129143055-2qtivjtkpzyb13zw
This commit is contained in:
Gery Debongnie 2014-01-29 15:30:55 +01:00
parent 23f4aca0a8
commit ddc1d840e7
2 changed files with 7 additions and 11 deletions

View File

@ -28,10 +28,6 @@ class mrp_workorder(osv.osv):
_description = "Work Order Report"
_auto = False
_columns = {
'year': fields.char('Year', size=64, 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),
'day': fields.char('Day', size=64, readonly=True),
'nbr': fields.integer('# of Lines', readonly=True),
'date': fields.date('Date', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
@ -50,9 +46,6 @@ class mrp_workorder(osv.osv):
create or replace view mrp_workorder as (
select
to_date(to_char(wl.date_planned, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
to_char(wl.date_planned, 'YYYY') as year,
to_char(wl.date_planned, 'MM') as month,
to_char(wl.date_planned, 'YYYY-MM-DD') as day,
min(wl.id) as id,
mp.product_id as product_id,
sum(wl.hour) as total_hours,

View File

@ -10,7 +10,10 @@
<field name="arch" type="xml">
<graph string="Work Orders" type="pivot">
<field name="state" type="row"/>
<field name="product_qty" type="measure"/>
<field name="nbr" type="measure"/>
<field name="total_hours" type="measure"/>
<field name="total_cycles" type="measure"/>
</graph>
</field>
</record>
@ -31,9 +34,9 @@
<filter string="Work Center" name="Workcenter" icon="terp-go-home" context="{'group_by':'workcenter_id'}" />
<filter string="Production" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'production_id'}"/>
<filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Planned Day"/>
<filter string="Month" name="terp-go-month" icon="terp-go-month" context="{'group_by':'month'}" help="Planned Month"/>
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Planned Year"/>
<filter string="Date Planned (day)" icon="terp-go-today" context="{'group_by':'date:day'}" help="Planned Day"/>
<filter string="Date Planned (month)" name="terp-go-month" icon="terp-go-month" context="{'group_by':'date:month'}" help="Planned Month"/>
<filter string="Date Planned (year)" icon="terp-go-year" context="{'group_by':'date:year'}" help="Planned Year"/>
</group>
</search>
</field>
@ -45,7 +48,7 @@
<field name="view_mode">graph</field>
<field name="view_id" ref="view_report_mrp_workorder_graph"/>
<field name="search_view_id" ref="view_report_mrp_workorder_filter"/>
<field name="context">{'search_default_Workcenter': 1,'search_default_year':1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_Workcenter': 1,'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<record model="ir.actions.act_window.view" id="action_report_mrp_workorder_graph">