[IMP] Sale: yaml improved for shipping
authorPAP(OpenERP) <>
Fri, 6 Aug 2010 13:29:59 +0000 (18:59 +0530)
committerMustufa Rangwala <mra@mra-laptop>
Fri, 6 Aug 2010 13:29:59 +0000 (18:59 +0530)
bzr revid: mra@mra-laptop-20100806132959-w24skraypvgxc0pq

addons/sale/test/invoice_on_shipped_qty.yml

index 9519156..06e90cb 100644 (file)
@@ -1,6 +1,6 @@
 -
   In order to test the Sale module in OpenERP,
-  I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Shipping & Manual Invoice' and Invoice on 'Shipped quantities' 
+  I create a Sale Order for Slider Mobile for 500 quantity having Shipping Policy 'Invoice from Picking' and Invoice on 'Shipped quantities' 
   in order to create an invoice based on the shipping quantity
 -
   !record {model: sale.order, id: sale_order_so6}:
@@ -17,7 +17,7 @@
         product_id: sale.product_product_slidermobile0
         product_uos_qty: 200.0
         type: make_to_order
-    order_policy: manual
+    order_policy: picking
     invoice_quantity: procurement
     partner_id: sale.res_partner_cleartrail0
     partner_invoice_id: sale.res_partner_address_2
        } 
        self.do_partial(cr, uid, [pick.id],partial_datas)
 -
- I click on Create Invoice button to create the invoice.
+  Then I create invoice from picking
 - 
-  !workflow {model: sale.order, action: manual_invoice, ref: sale_order_so6}
+  !record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_6}:
+    invoice_date: '2010-07-17'
+    journal_id: account.sales_journal
+    type: out_invoice
+-
+  Then I click on 'Create Invoices' button
+-
+  !python {model: stock.invoice.onshipping}: |
+    sale_obj = self.pool.get('sale.order')  
+    sale_id = sale_obj.browse(cr, uid, ref("sale_order_so6"))
+    picking_obj = self.pool.get('stock.picking')
+    ids = picking_obj.search(cr, uid, [('origin', '=', sale_id.name)])
+    self.create_invoice(cr, uid, [ref("stock_invoice_onshipping_6")], {"lang": "en_US",
+      "search_default_available": 1, "tz": False, "active_model": "stock.picking",
+      "contact_display": "partner", "active_ids": ids, "active_id": ids[0]})
 -
   I verify whether the invoice has been generated for SO
 -
@@ -75,7 +89,7 @@
     so = self.browse(cr, uid, ref("sale_order_so6"))
     assert so.invoice_ids, "Invoices has not been generated for sale_order_so6"
 -
- I verify that an invoice is created on the basis of shipped quantity
+  I verify that an invoice is created on the basis of shipped quantity
 -
   !python {model: account.invoice}: |
     sale_order_obj = self.pool.get('sale.order')