[IMP] mrp: Production view, display scrap move lines in red color in consumed move
authorHarry (Open ERP) <hmo@tinyerp.com>
Thu, 18 Mar 2010 07:14:12 +0000 (12:44 +0530)
committerHarry (Open ERP) <hmo@tinyerp.com>
Thu, 18 Mar 2010 07:14:12 +0000 (12:44 +0530)
bzr revid: hmo@tinyerp.com-20100318071412-da4disjgjqfkpctf

addons/mrp/mrp_view.xml
addons/stock/stock_wizard.py

index 4edf2c7..e307118 100644 (file)
 
                             <field colspan="2" name="move_lines2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
                                                widget="one2many_list" mode="tree,form" height="275">
-                                       <tree string="Consumed Products" editable="bottom" colors="red:state=='cancel';black:state=='done';">
+                                       <tree string="Consumed Products" editable="bottom" colors="red:scraped==True">
                                                <field name="product_id" readonly="1"/>
                                                <field name="product_qty" readonly="1" string="Qty"/>
                                                    <field name="product_uom" readonly="1" string="UOM"/>
                                     <field name="location_dest_id"  readonly="1" string="Destination Loc."/>
                                                    <field name="prodlot_id" />
                                     <field name="state" invisible="1"/>
+                                    <field name="scraped" invisible="1"/>
                                                <button
                                                        name="%(stock.track_line)d"
                                                        string="Split in production lots"
 
                             <field colspan="2" name="move_created_ids2" nolabel="1"  domain="[('state','in', ('done', 'cancel'))]"
                                                widget="one2many_list" mode="tree,form" height="275">
-                                       <tree string="Finished Products" editable="bottom">
+                                       <tree string="Finished Products" editable="bottom" colors="red:scraped==True">
                                                <field name="product_id" readonly="1"/>
                                                <field name="product_qty" readonly="1" string="Qty"/>
                                                    <field name="product_uom" readonly="1" string="UOM"/>
                                     <field name="location_dest_id"  readonly="1" string="Destination Loc."/>
                                                <field name="prodlot_id" />
                                     <field name="state" invisible="1"/>
+                                    <field name="scraped" invisible="1"/>
                                                <button name="%(stock.track_line)d"
                                             string="Split in production lots" type="action" icon="gtk-justify-fill" states="done,cancel"/>
                                                <button name="%(stock.move_scrap)d"
index 543ec02..eb522c2 100644 (file)
@@ -172,7 +172,7 @@ class split_in_production_lot(osv.osv_memory):
                                                  {'product_id': move.product_id.id})                    
                     move_obj.write(cr, uid, [current_move], {'prodlot_id': prodlot_id})
                     prodlot = prodlot_obj.browse(cr, uid, prodlot_id) 
-                    ref = '%d' % (current_move)
+                    ref = '%d' % (move.id)
                     if prodlot.ref:
                         ref = '%s, %s' % (prodlot.ref, ref) 
                     prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref})