[MERGE]
authorHarry (Open ERP) <hmo@tinyerp.com>
Wed, 17 Mar 2010 11:22:32 +0000 (16:52 +0530)
committerHarry (Open ERP) <hmo@tinyerp.com>
Wed, 17 Mar 2010 11:22:32 +0000 (16:52 +0530)
bzr revid: hmo@tinyerp.com-20100317112232-2kcn8f1pluo61cbb

1  2 
addons/mrp/mrp.py

@@@ -1107,7 -1115,7 +1107,20 @@@ class mrp_procurement(osv.osv)
          return True
  
      def action_produce_assign_product(self, cr, uid, ids, context={}):
-         produce_id = False
++        """
++        @summary : This is action which call from workflow to assign production order to procuments
++        @return  : True
++        """
++        res = self.make_mo(cr, uid, ids, context=context)
++        return 1 #TO CHECK: why workflow is generated error if return True
++
++    def make_mo(self, cr, uid, ids, context={}):
++        """
++        @summary : Make Manufecturing(production) order from procurement
++        
++        @return : New created Production Orders procurement wise 
++        """
+         res = {}
          company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
          for procurement in self.browse(cr, uid, ids):
              res_id = procurement.move_id.id
              wf_service.trg_validate(uid, 'mrp.production', produce_id, 'button_confirm', cr)
              self.pool.get('stock.move').write(cr, uid, [res_id],
                      {'location_id':procurement.location_id.id})
-         return produce_id
+         return res
 -
++    
      def action_po_assign(self, cr, uid, ids, context={}):
-         purchase_id = False
++        """
++        @summary : This is action which call from workflow to assign purchase order to procuments
++        @return  : True
++        """
++        res = self.make_po(cr, uid, ids, context=context)
++        return 1 #TO CHECK: why workflow is generated error if return True
++
++    def make_po(self, cr, uid, ids, context={}):
++        """
++        @summary : Make purchase order from procurement
++        
++        @return : New created Purchase Orders procurement wise
++        """
+         res = {}
          company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
          for procurement in self.browse(cr, uid, ids):
              res_id = procurement.move_id.id