[MERGE] Fix copy_data for merge
authorJosse Colpaert <jco@odoo.com>
Mon, 7 Jul 2014 12:33:01 +0000 (14:33 +0200)
committerJosse Colpaert <jco@odoo.com>
Mon, 7 Jul 2014 12:33:01 +0000 (14:33 +0200)
1  2 
addons/calendar/calendar.py
addons/mrp/mrp.py
addons/mrp/product.py
addons/mrp/stock.py
addons/purchase/purchase.py
addons/purchase/stock.py
addons/stock/stock.py
addons/stock/stock_view.xml

Simple merge
Simple merge
@@@ -41,24 -41,16 +41,36 @@@ class product_template(osv.osv)
          return res
  
      _columns = {
++<<<<<<< HEAD
 +        'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."),
 +        'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"),
++=======
++>>>>>>> odoo/8.0
          'bom_ids': fields.one2many('mrp.bom', 'product_tmpl_id','Bill of Materials'),
          'bom_count': fields.function(_bom_orders_count, string='# Bill of Material', type='integer', multi="_bom_order_count"),
          'mo_count': fields.function(_bom_orders_count_mo, string='# Manufacturing Orders', type='integer'),
+         'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."),
+         'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"),
+     }
+     
+     _defaults = {
+         "produce_delay": 1,
      }
++<<<<<<< HEAD
 +
 +    _defaults = {
 +        "produce_delay": 1,
 +    }
 +
 +    def copy(self, cr, uid, id, default=None, context=None):
 +        if not default:
 +            default = {}
 +        default.update({
 +            'bom_ids': []
 +        })
 +        return super(product_template, self).copy(cr, uid, id, default, context=context)
++=======
++>>>>>>> odoo/8.0
  
  class product_product(osv.osv):
      _inherit = "product.product"
      _columns = {
          'mo_count': fields.function(_bom_orders_count, string='# Manufacturing Orders', type='integer'),
      }
++<<<<<<< HEAD
++=======
++>>>>>>> odoo/8.0
  
  
  # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Simple merge
Simple merge
@@@ -48,11 -48,9 +48,9 @@@ class stock_move(osv.osv)
      def copy(self, cr, uid, id, default=None, context=None):
          if not default:
              default = {}
 -        if not default.get('split_from'):
 +        if not default.get('split_from') and not context.get('split'):
              #we don't want to propagate the link to the purchase order line except in case of move split
-             default.update({
-                 'purchase_line_id': False,
-             })
+             default['purchase_line_id'] = False
          return super(stock_move, self).copy(cr, uid, id, default, context)
  
  
@@@ -1734,6 -1731,6 +1731,7 @@@ class stock_move(osv.osv)
          'date_expected': fields.datetime.now,
          'procure_method': 'make_to_stock',
          'propagate': True,
++        'partially_available': False,
      }
  
      def _check_uom(self, cr, uid, ids, context=None):
              ['product_uom']),
      ]
  
-     def copy_data(self, cr, uid, id, default=None, context=None):
-         if default is None:
-             default = {}
-         default = default.copy()
-         default['quant_ids'] = []
-         default['reserved_quant_ids'] = []
-         default['returned_move_ids'] = []
-         default['linked_move_operation_ids'] = []
-         default['partially_available'] = False
-         if not default.get('move_orig_ids'):
-             default['move_orig_ids'] = []
-         if not default.get('move_dest_id'): 
-             default['move_dest_id'] = False
-         if not default.get('procurement_id'):
-             default['procurement_id'] = False
-         if not default.get('origin_returned_move_id'):
-             default['origin_returned_move_id'] = False
-         default['state'] = 'draft'
-         return super(stock_move, self).copy_data(cr, uid, id, default, context)
 -    @api.cr_uid_ids_context
 +
      def do_unreserve(self, cr, uid, move_ids, context=None):
          quant_obj = self.pool.get("stock.quant")
          for move in self.browse(cr, uid, move_ids, context=context):
Simple merge