[WIP] Undo ondelete settings, work out of dropship tests
authorJosse Colpaert <jco@openerp.com>
Tue, 23 Jul 2013 07:50:53 +0000 (09:50 +0200)
committerJosse Colpaert <jco@openerp.com>
Tue, 23 Jul 2013 07:50:53 +0000 (09:50 +0200)
bzr revid: jco@openerp.com-20130723075053-4bodpyhx5oliz14q

addons/procurement/procurement.py
addons/stock/stock.py
addons/stock_complex_routes/test/dropship.yml

index daeeb8f..de4d6d9 100644 (file)
@@ -58,6 +58,7 @@ class procurement_group(osv.osv):
     _columns = {
         'name': fields.char('Reference'), 
         'partner_id': fields.many2one('res.partner', string = 'Partner'), #Sale should pass it here 
+        'procurement_ids': fields.many2one('procurement.order', 'group_id', 'Procurements'), 
     }
     _defaults = {
         'name': lambda self, cr, uid, c: self.pool.get('ir.sequence').get(cr, uid, 'procurement.group') or ''
index c35abb3..22c54f6 100644 (file)
@@ -2305,11 +2305,11 @@ class stock_package(osv.osv):
                                          store={'stock.quant.package': (_get_subpackages, ['name', 'parent_id'], 10)}),
         'parent_left': fields.integer('Left Parent', select=1),
         'parent_right': fields.integer('Right Parent', select=1),
-        'packaging_id': fields.many2one('product.packaging', 'Type of Packaging'),
+        'packaging_id': fields.many2one('product.packaging', 'Type of Packaging', type="many2one"),
+        'quant_ids': fields.one2many('stock.quant', 'package_id', 'Bulk Content'),
         'location_id': fields.related('quant_ids', 'location_id', type='many2one', relation='stock.location', string='Location', 
                                       store = {'stock.quant': (_get_packages, ['location_id'], 10)}, readonly=True),
-        'quant_ids': fields.one2many('stock.quant', 'package_id', 'Bulk Content'),
-        'parent_id': fields.many2one('stock.quant.package', 'Container Package', help="The package containing this item", ondelete = "cascade"),
+        'parent_id': fields.many2one('stock.quant.package', 'Container Package', help="The package containing this item"),
         'children_ids': fields.one2many('stock.quant.package', 'parent_id', 'Contained Packages'),
 
     }
index 4a46532..7bcb1b9 100644 (file)
@@ -1,21 +1,53 @@
 - 
-  Create new product candy without any routes
+  Create new product without any routes
 - 
   !record {model:product.product, id:}
 - 
   Create a sales order with a line of 200 PCE incoming shipment, with route_id drop shipping
 - 
-  !record {model: sale.order}
+  !record {model: sale.order, id: } :
+    customer:
+    - product_id: 
+      product_qty: 200 
+      product_uom:
+      supplier_ids:
+         
     
 - 
   Confirm sales order
 - 
   !python{model: sale.order}: |
-
+    self.browse(cr, uid, ref()).action_b
 - 
-  Run schedulers
+  Check the sales order created a procurement group which has a procurement of 200 pieces
 - 
-  !python{model: procurement.order, id: }: |
-    
+  !python{model: procurement.group}: |
+    proc_group = self.search(cr, uid, [('sale_id', '=', ref())])
+    assert self.browse(cr, uid, proc_group)[0].procurement_ids[0].product_qty == 200 
+- 
+  Check a quotation was created to a certain supplier and confirm so it becomes a confirmed purchase order
+- 
+  
+- 
+  Check the sales order has one picking with 200 pieces
+- 
+  !python{model: sale.order}: |
+    assert len(self.browse(cr, uid, ref()).picking_ids) == 1
+- 
+  Use 'View Delivery Order' button to immediately view this picking and check shipped of purchase order is False
+- 
+  
+- 
+  Send the 200 pieces
+- 
+  !python{model: stock.partial.picking}: |
+  
+  
+- 
+  Check one quant was created in Customers location with 200 pieces and one move in the move_history_ids
+- 
+  
+- 
+  Check the sum of the moves related to this product and the sum of the quants is equal
 -