report_mrp: remove stock_move from the query
bzr revid: ced-51b0840bb3fdbb6797bd8dd1e99a7a25afe14921
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
{
|
||||
"name" : "MRP Management - Reporting",
|
||||
"version" : "1.0",
|
||||
"author" : "Tiny",
|
||||
"website" : "http://tinyerp.com/module_mrp.html",
|
||||
"depends" : ["mrp"],
|
||||
"category" : "Generic Modules/Production",
|
||||
"description": "A module that adds new reports based on MRP cases.",
|
||||
"init_xml" : [],
|
||||
"demo_xml" : [],
|
||||
"update_xml" : ["report_mrp_view.xml"],
|
||||
"active": False,
|
||||
"installable": True
|
||||
"name": "MRP Management - Reporting",
|
||||
"version": "1.0",
|
||||
"author": "Tiny",
|
||||
"website": "http://tinyerp.com/module_mrp.html",
|
||||
"depends": ["mrp"],
|
||||
"category": "Generic Modules/Production",
|
||||
"description": "A module that adds new reports based on MRP cases.",
|
||||
"init_xml": [],
|
||||
"demo_xml": [],
|
||||
"update_xml": ["report_mrp_view.xml"],
|
||||
"installable": True
|
||||
}
|
||||
|
||||
@@ -1,3 +1,32 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004-2007 TINY SPRL. (http://tiny.be) All Rights Reserved.
|
||||
#
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract a Free Software
|
||||
# Service Company
|
||||
#
|
||||
# This program is Free Software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
|
||||
|
||||
@@ -11,12 +40,13 @@ class report_workcenter_load(osv.osv):
|
||||
'cycle': fields.float('Nbr of cycle'),
|
||||
'hour': fields.float('Nbr of hour'),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
cr.execute("""
|
||||
create or replace view report_workcenter_load as (
|
||||
SELECT
|
||||
min(wl.id) as id,
|
||||
to_char(stock_move.create_date,'YYYY:IW') as name,
|
||||
to_char(create_date,'YYYY:IW') as name,
|
||||
SUM(wl.hour) AS hour,
|
||||
SUM(wl.cycle) AS cycle,
|
||||
wl.workcenter_id as workcenter_id
|
||||
@@ -24,10 +54,12 @@ class report_workcenter_load(osv.osv):
|
||||
mrp_production_workcenter_line wl
|
||||
GROUP BY
|
||||
wl.workcenter_id,
|
||||
to_char(stock_move.create_date,'YYYY:IW')
|
||||
to_char(create_date,'YYYY:IW')
|
||||
)""")
|
||||
|
||||
report_workcenter_load()
|
||||
|
||||
|
||||
class report_mrp_inout(osv.osv):
|
||||
_name="report.mrp.inout"
|
||||
_description="Stock value variation"
|
||||
@@ -37,6 +69,7 @@ class report_mrp_inout(osv.osv):
|
||||
'date': fields.char('Week', size=64, required=True),
|
||||
'value': fields.float('Stock value', required=True),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
cr.execute("""
|
||||
create or replace view report_mrp_inout as (
|
||||
@@ -67,5 +100,6 @@ class report_mrp_inout(osv.osv):
|
||||
group by
|
||||
to_char(sm.date_planned,'YYYY:IW')
|
||||
)""")
|
||||
|
||||
report_mrp_inout()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user