[Fix] stock: fix the graph view of Moves Analysis,remove all views and code that are used dashboard
bzr revid: sbh@tinyerp.com-20101004072606-n7n3q0dmi4kmxmll
This commit is contained in:
parent
71d15a2b94
commit
29f101668d
|
@ -40,9 +40,7 @@
|
|||
|
||||
<child2>
|
||||
|
||||
<action colspan="4" name="%(stock.action_move_graph_reception_picking)d" string="Number of Products to receive Vs planned" width="510"/>
|
||||
<!-- <action colspan="4" name="%(stock.action_move_delivery_products_planned)d" string="Delivery Products Vs Planned" width="510"/>
|
||||
--> </child2>
|
||||
</child2>
|
||||
</hpaned>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<graph string="Moves Analysis" type="bar">
|
||||
<field name="product_id"/>
|
||||
<field name="day_diff2" operator="avg"/>
|
||||
<field name="day_diff2" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
"access_stock_lines_date_manager","report.stock.lines.date manager","model_report_stock_lines_date","stock.group_stock_manager",1,1,1,1
|
||||
"access_stock_lines_date_system","report.stock.lines.date system","model_report_stock_lines_date","base.group_system",1,0,0,0
|
||||
"access_stock_report_tracklots","stock.report.tracklots","model_stock_report_tracklots","stock.group_stock_user",1,1,1,1
|
||||
"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,1,1,1
|
||||
"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,1,1,1
|
||||
"access_report_stock_move_user","report.stock.move user","model_report_stock_move","stock.group_stock_user",1,0,0,0
|
||||
"access_report_stock_move_system","report.stock.move system","model_report_stock_move","base.group_system",1,0,0,0
|
||||
"access_report_stock_move_manager","report.stock.move manager","model_report_stock_move","stock.group_stock_manager",1,1,1,1
|
||||
|
|
|
|
@ -2561,73 +2561,5 @@ class stock_picking_move_wizard(osv.osv_memory):
|
|||
|
||||
stock_picking_move_wizard()
|
||||
|
||||
class report_products_to_received_planned(osv.osv):
|
||||
_name = "report.products.to.received.planned"
|
||||
_description = "Received Products vs Planned"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'date':fields.date('Date'),
|
||||
'qty': fields.float('Actual Qty', digits_compute=dp.get_precision('Product UoM')),
|
||||
'planned_qty': fields.float('Planned Qty', digits_compute=dp.get_precision('Product UoM')),
|
||||
|
||||
}
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'report_products_to_received_planned')
|
||||
cr.execute("""
|
||||
create or replace view report_products_to_received_planned as (
|
||||
select stock.create_date as date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
|
||||
from stock_picking picking
|
||||
inner join stock_move stock
|
||||
on picking.id = stock.picking_id and picking.type = 'in'
|
||||
where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
|
||||
group by stock.create_date
|
||||
|
||||
union
|
||||
|
||||
select stock.date as date , min(stock.id) as id, 0 as actual_qty, sum(stock.product_qty) as planned_qty
|
||||
from stock_picking picking
|
||||
inner join stock_move stock
|
||||
on picking.id = stock.picking_id and picking.type = 'in'
|
||||
where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
|
||||
group by stock.date
|
||||
)
|
||||
""")
|
||||
|
||||
report_products_to_received_planned()
|
||||
|
||||
class report_delivery_products_planned(osv.osv):
|
||||
_name = "report.delivery.products.planned"
|
||||
_description = "Delivered products vs Planned"
|
||||
_auto = False
|
||||
_columns = {
|
||||
'date':fields.date('Date'),
|
||||
'qty': fields.float('Actual Qty', digits_compute=dp.get_precision('Product UoM')),
|
||||
'planned_qty': fields.float('Planned Qty', digits_compute=dp.get_precision('Product UoM')),
|
||||
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'report_delivery_products_planned')
|
||||
cr.execute("""
|
||||
create or replace view report_delivery_products_planned as (
|
||||
select stock.create_date as date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
|
||||
from stock_picking picking
|
||||
inner join stock_move stock
|
||||
on picking.id = stock.picking_id and picking.type = 'out'
|
||||
where stock.create_date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
|
||||
group by stock.create_date
|
||||
|
||||
union
|
||||
|
||||
select stock.date as date, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty
|
||||
from stock_picking picking
|
||||
inner join stock_move stock
|
||||
on picking.id = stock.picking_id and picking.type = 'out'
|
||||
where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
|
||||
group by stock.date
|
||||
)
|
||||
""")
|
||||
|
||||
report_delivery_products_planned()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1953,78 +1953,6 @@
|
|||
<field eval="True" name="object"/>
|
||||
</record>
|
||||
|
||||
<!-- Graph Views -->
|
||||
<!-- Products To Received Vs Planned -->
|
||||
<record model="ir.ui.view" id="view_move_graph_reception_picking_tree">
|
||||
<field name="name">Products To Received</field>
|
||||
<field name="model">report.products.to.received.planned</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Products To Received" >
|
||||
<field name="qty" />
|
||||
<field name="planned_qty" />
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_move_graph_reception_picking">
|
||||
<field name="name">Products To Received</field>
|
||||
<field name="model">report.products.to.received.planned</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Products To Received" type="bar" orientation="vertical">
|
||||
<field name="date"/>
|
||||
<field name="qty" operator="+"/>
|
||||
<field name="planned_qty" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_move_graph_reception_picking" model="ir.actions.act_window">
|
||||
<field name="name">Number of Products to receive Vs planned</field>
|
||||
<field name="res_model">report.products.to.received.planned</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_move_graph_reception_picking"/>
|
||||
</record>
|
||||
|
||||
<!-- Delivery Product Vs Planned -->
|
||||
<record model="ir.ui.view" id="view_move_delivery_products_planned_tree">
|
||||
<field name="name">Delivery Products</field>
|
||||
<field name="model">report.delivery.products.planned</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Products To Received" >
|
||||
<field name="qty" />
|
||||
<field name="planned_qty" />
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_move_delivery_products_planned_graph">
|
||||
<field name="name">Delivery Products</field>
|
||||
<field name="model">report.delivery.products.planned</field>
|
||||
<field name="type">graph</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="Products To Received" type="bar" orientation="vertical">
|
||||
<field name="date"/>
|
||||
<field name="qty" operator="+"/>
|
||||
<field name="planned_qty" operator="+"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_move_delivery_products_planned" model="ir.actions.act_window">
|
||||
<field name="name">Delivery Products Vs Planned</field>
|
||||
<field name="res_model">report.delivery.products.planned</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">graph,tree</field>
|
||||
<field name="view_id" ref="view_move_delivery_products_planned_graph"/>
|
||||
</record>
|
||||
|
||||
<record id="action_picking_tree_out" model="ir.actions.act_window">
|
||||
<field name="name">Customers Packings</field>
|
||||
|
|
Loading…
Reference in New Issue