~acysos-team/acysos/openerp-addons-6.0

« back to all changes in this revision

Viewing changes to acy_mrp_operator/mrp_operator.py

  • Committer: Ignacio Ibeas - Acysos S.L.
  • Date: 2013-03-26 14:19:09 UTC
  • Revision ID: ignacio@acysos.com-20130326141909-6p5889wjqb1jvnpg
[FIX] acy_mrp_operator: fix defective products

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
                    if not workcenter_line.product_id:
65
65
                        raise osv.except_osv(_('Error'), _("Can't use a workcenter without product %s") % (workcenter_line.name))
66
66
                prod_obj.action_in_production(cr,uid,workcenter_line.production_id.id)
67
 
                if sequence == workcenter_line.workcenter_line_id.sequence:
68
 
                    if workcenter_line.go_product_qty > 0:
69
 
                        prod_obj.action_produce(cr, uid,workcenter_line.production_id.id,workcenter_line.go_product_qty,'consume_produce',context)
70
 
                        
 
67
                
71
68
                for workcenter_line2 in registry.workcenter_lines:
72
69
                    if workcenter_line.production_id.id == workcenter_line2.production_id.id:
73
70
                        if workcenter_line2.workcenter_line_id.sequence <= workcenter_line.workcenter_line_id.sequence:
94
91
                                    defective_qty = bom.product_qty*bom.product_efficiency*workcenter_line.de_product_qty
95
92
                                    context = {'operator_registry':1,'location_src':workcenter_line2.production_id.location_src_id.id}
96
93
                                    stock_obj.action_scrap(cr, uid,stock_move_id,defective_qty,4,context)
 
94
                
 
95
                if sequence == workcenter_line.workcenter_line_id.sequence:
 
96
                    if workcenter_line.go_product_qty > 0:
 
97
                        prod_obj.action_produce(cr, uid,workcenter_line.production_id.id,workcenter_line.go_product_qty,'consume_produce',context)
97
98
        
98
99
        self.write(cr, uid, ids, {'state': 'confirmed'})
99
100
        return True