[IMP]: event: Added more assert for generated invoiced in register2invoice.yml

bzr revid: ron@tinyerp.com-20111114070748-wu67m8d9ddpiqdy8
This commit is contained in:
ron@tinyerp.com 2011-11-14 12:37:48 +05:30
parent 77c716683e
commit 64a531e000
1 changed files with 5 additions and 0 deletions

View File

@ -20,4 +20,9 @@
!python {model: event.registration}: |
record = self.browse(cr, uid, [ref("reg_1_1")])[0]
assert record.invoice_id, "Invoice should be generated"
assert record.invoice_id.state == "draft", "Invoice state should be draft"
assert record.invoice_id.partner_id == record.partner_id, "Customer is not correspond with registration"
assert record.invoice_id.type == 'out_invoice', "Invoice type is not correct"
assert record.invoice_id.origin == record.event_product, "Invoice origin is not correct"
assert record.invoice_id.amount_total == record.price_subtotal, "Invoice origin is not correct"
assert record.state == "done", "Registration should be closed after invoice generated"