← Back to team overview

openerp-chinese-team team mailing list archive

lp:~openerp-chinese-team/openobject-addons/7.0-mrp-stock-picking-reference-fix into lp:openobject-addons/7.0

 

Joshua Jan(SHINEIT) has proposed merging lp:~openerp-chinese-team/openobject-addons/7.0-mrp-stock-picking-reference-fix into lp:openobject-addons/7.0.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1117229 in OpenERP Addons: "[MRP-Reference] manufacturing orders stock moves have a "False" in the reference field"
  https://bugs.launchpad.net/openobject-addons/+bug/1117229

For more details, see:
https://code.launchpad.net/~openerp-chinese-team/openobject-addons/7.0-mrp-stock-picking-reference-fix/+merge/194976
-- 
https://code.launchpad.net/~openerp-chinese-team/openobject-addons/7.0-mrp-stock-picking-reference-fix/+merge/194976
Your team Open ERP Chinese is subscribed to branch lp:~openerp-chinese-team/openobject-addons/7.0-mrp-stock-picking-reference-fix.
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py	2013-09-24 06:26:48 +0000
+++ mrp/mrp.py	2013-11-13 03:01:41 +0000
@@ -593,7 +593,7 @@
         """
         self.write(cr, uid, ids, {'state': 'picking_except'})
         return True
-    
+
     def _action_compute_lines(self, cr, uid, ids, properties=None, context=None):
         """ Compute product_lines and workcenter_lines from BoM structure
         @return: product_lines
@@ -610,10 +610,10 @@
         for production in self.browse(cr, uid, ids, context=context):
             #unlink product_lines
             prod_line_obj.unlink(cr, SUPERUSER_ID, [line.id for line in production.product_lines], context=context)
-    
+
             #unlink workcenter_lines
             workcenter_line_obj.unlink(cr, SUPERUSER_ID, [line.id for line in production.workcenter_lines], context=context)
-    
+
             # search BoM structure and route
             bom_point = production.bom_id
             bom_id = production.bom_id.id
@@ -623,21 +623,21 @@
                     bom_point = bom_obj.browse(cr, uid, bom_id)
                     routing_id = bom_point.routing_id.id or False
                     self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id})
-    
+
             if not bom_id:
                 raise osv.except_osv(_('Error!'), _("Cannot find a bill of material for this product."))
-    
+
             # get components and workcenter_lines from BoM structure
             factor = uom_obj._compute_qty(cr, uid, production.product_uom.id, production.product_qty, bom_point.product_uom.id)
             res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, properties, routing_id=production.routing_id.id)
             results = res[0] # product_lines
             results2 = res[1] # workcenter_lines
-    
+
             # reset product_lines in production order
             for line in results:
                 line['production_id'] = production.id
                 prod_line_obj.create(cr, uid, line)
-    
+
             #reset workcenter_lines in production order
             for line in results2:
                 line['production_id'] = production.id
@@ -681,7 +681,7 @@
                 produce_move_id = self._make_production_produce_line(cr, uid, production, context=context)
                 for scheduled in production.product_lines:
                     self._make_production_line_procurement(cr, uid, scheduled, False, context=context)
-        
+
             if production.move_prod_id and production.move_prod_id.location_id.id != production.location_dest_id.id:
                 move_obj.write(cr, uid, [production.move_prod_id.id],
                         {'location_id': production.location_dest_id.id})
@@ -884,7 +884,7 @@
 
     def _get_auto_picking(self, cr, uid, production):
         return True
-    
+
     def _hook_create_post_procurement(self, cr, uid, production, procurement_id, context=None):
         return True
 
@@ -955,7 +955,7 @@
             partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False
 
         # Take next Sequence number of shipment base on type
-        pick_name = ir_sequence.get(cr, uid, 'stock.picking.' + pick_type)
+        pick_name = ir_sequence.get(cr, uid, 'stock.picking' + (pick_type != 'internal' and '.' + pick_type or '' ))
 
         picking_id = stock_picking.create(cr, uid, {
             'name': pick_name,


Follow ups