-
 I confirm another order where invoice control is 'Bases on incoming shipments'.
-
  !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_2}
-
  I check that the invoice of order.
-
  !python {model: purchase.order}: |
    purchase_order = self.browse(cr, uid, ref("purchase_order_2"))
    assert len(purchase_order.invoice_ids) == 0, "Invoice should not be generated on order confirmation."
-
  Now I create an invoice for order on reception.
-
  !python {model: stock.picking}: |
    pick_ids = self.search(cr, uid, [('purchase_id','=',ref('purchase_order_2'))])
    self.action_invoice_create(cr, uid, pick_ids, ref('account.expenses_journal'))
-
 I check that the invoice of order.
-
 !python {model: purchase.order}: |
    purchase_order = self.browse(cr, uid, ref("purchase_order_2"))
    assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."



-
 I confirm another order where invoice control is 'Bases on incoming shipments'.
-
  !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_2}
-
  I check that the invoice of order.
-
  !python {model: purchase.order}: |
    purchase_order = self.browse(cr, uid, ref("purchase_order_2"))
    assert len(purchase_order.invoice_ids) == 0, "Invoice should not be generated on order confirmation."
-
  Now I create an invoice for order on reception.
-
  !python {model: purchase.order}: |
    pick_ids = [self.browse(cr, uid, ref("purchase_order_2")).id]
    self.action_invoice_create(cr, uid, pick_ids)
-
 I check that the invoice of order.
-
 !python {model: purchase.order}: |
    purchase_order = self.browse(cr, uid, ref("purchase_order_2"))
    assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."



Merge yml purchase gen invoice
[MERGE] Merge yml purchase gen invoice

bzr revid: jco@openerp.com-20130826164601-whs23j29wupk4vsw