[IMP]:create invoice on po line
bzr revid: ksa@tinyerp.com-20111206110804-ydk9e2cyuk2erejn
This commit is contained in:
parent
78dcac034a
commit
07f69837f5
|
@ -67,6 +67,7 @@ Dashboard for purchase management that includes:
|
|||
'test/process/run_scheduler.yml',
|
||||
'test/process/merge_order.yml',
|
||||
'test/process/edi_purchase_order.yml',
|
||||
'test/process/invoice_on_poline.yml',
|
||||
'test/ui/print_report.yml',
|
||||
'test/ui/duplicate_order.yml',
|
||||
'test/ui/delete_order.yml',
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
-
|
||||
In order to test the flow, I start it from confirmed purchase order.
|
||||
-
|
||||
!workflow {model: purchase.order, action: purchase_confirm, ref: order_purchase6}
|
||||
-
|
||||
In order to test create invoice for purchase order line.
|
||||
-
|
||||
!python {model: purchase.order}: |
|
||||
invoice_line_obj = self.pool.get('purchase.order.line_invoice')
|
||||
purchase_order = self.browse(cr, uid, ref("order_purchase6"))
|
||||
context.update({'active_model': 'purchase.order', 'active_ids': [ref("order_purchase6")]})
|
||||
for purchase_line in purchase_order.order_line:
|
||||
invoice_line_obj.makeInvoices(cr, uid, purchase_line.id, context=context)
|
||||
assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."
|
||||
assert purchase_line.invoiced == True
|
||||
assert len(purchase_line.invoice_lines) == 1, "Invoice line should be generated."
|
||||
|
Loading…
Reference in New Issue