'day': fields.char('Day',size=64,readonly=True),
'origin': fields.char('Source Document', size=64),
'nbr': fields.integer('# of Orders', readonly=True),
+ 'products_to_consumme': fields.integer('Products to Consumme', readonly=True),
+ 'consummed_products': fields.integer('Consummed Products', readonly=True),
'date': fields.date('Date', readonly=True),
'product_id': fields.many2one('product.product', 'Product', readonly=True),
'product_qty': fields.float('Product Qty', readonly=True),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material',readonly=True),
'routing_id': fields.many2one('mrp.routing', string='Routing',readonly=True),
'picking_id': fields.many2one('stock.picking', 'Picking list', readonly=True),
+ 'product_uom': fields.many2one('product.uom', 'Product UOM', readonly=True),
'priority': fields.selection([('0','Not urgent'),
('1','Normal'),
('2','Urgent'),
to_char(s.create_date, 'MM') as month,
to_char(s.create_date, 'YYYY-MM-DD') as day,
l.product_id as product_id,
+ l.product_uom,
sum(l.product_qty * u.factor) as product_qty,
s.company_id as company_id,
count(*) as nbr,
+ (select count(ll.id) from mrp_production_move_ids as mv
+ left join stock_move as sm ON (sm.id=mv.move_id)
+ left join mrp_production_product_line as ll ON (ll.id=mv.production_id)
+ where sm.state not in ('done','cancel') and ll.id=l.id
+ group by ll.id) as products_to_consumme,
+ (select count(ll.id) from mrp_production_move_ids as mv
+ left join stock_move as sm ON (sm.id=mv.move_id)
+ left join mrp_production_product_line as ll ON (ll.id=mv.production_id)
+ where sm.state in ('done','cancel') and ll.id=l.id
+ group by ll.id) as consummed_products,
s.location_src_id,
s.location_dest_id,
s.bom_id,
s.origin,
s.priority,
s.state
- from
- mrp_production_product_line l
- left join
- mrp_production s on (s.id=l.production_id)
- left join product_uom u on (u.id=l.product_uom)
+ from mrp_production_product_line l
+ left join mrp_production s on (s.id=l.production_id)
+ left join product_uom u on (u.id=l.product_uom)
group by
to_char(s.create_date, 'YYYY'),
to_char(s.create_date, 'MM'),
to_date(to_char(s.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY'),
l.product_id,
l.product_uom,
+ l.id,
s.bom_id,
s.routing_id,
s.picking_id,
<field name="bom_id" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="product_qty" sum='Product Qty'/>
+ <field name="products_to_consumme" sum='Products to Consumme'/>
+ <field name="consummed_products" sum='Consummed Products'/>
<field name="nbr" string="#Production Orders" sum='#Production Orders'/>
<field name="state" invisible="1"/>
<field name="routing_id" invisible="1"/>
<field name="date" invisible="1"/>
<field name="location_src_id" invisible="1"/>
<field name="location_dest_id" invisible="1"/>
+ <field name="priority" invisible="1"/>
+ <field name="product_uom" invisible="1"/>
</tree>
</field>
</record>
<field name="origin"/>
<field name="product_id"/>
<field name="bom_id"/>
+ <field name="picking_id"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-mrp" string="Picking Exception" domain="[('state','=','picking_except')]"/>
<filter icon="terp-mrp" string="Done" domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
- <field name="location_src_id" widget="selection"/>
- <field name="picking_id" widget="selection"/>
+
<field name="date_start"/>
+ <separator orientation="vertical"/>
+ <field name="product_uom" widget="selection"/>
+ <field name="location_src_id" widget="selection"/>
+ <field name="priority"/>
<newline/>
<filter icon="terp-mrp" string="Ready to Produce " domain="[('state','=','ready')]"/>
<filter icon="terp-mrp" string="Cancelled" domain="[('state','=','cancel')]"/>
<separator orientation="vertical"/>
+ <field name="date_finnished"/>
+ <separator orientation="vertical"/>
<field name="location_dest_id" widget="selection"/>
<field name="routing_id" widget="selection"/>
- <field name="date_finnished"/>
+ <field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="date_planned"/>
- <field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="6">
<filter string="BOM" icon="terp-mrp" context="{'group_by':'bom_id'}"/>
<filter string="State" icon="terp-mrp" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
+ <filter string="Product UOM" icon="terp-mrp" context="{'group_by':'product_uom'}"/>
<filter string="Day" icon="terp-mrp" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-mrp" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-mrp" context="{'group_by':'year'}"/>