odoo/addons/mrp_repair/test/test_mrp_repair_afterinv.yml

37 lines
1.4 KiB
YAML

-
In order to test invoice type after repair.
-
I Confirm Repair order For Invoice Type After repair.
-
!workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rmrp0}
-
I start the repairing process by click on "Start Repair" Button For Invoice Type After repair.
-
!workflow {model: mrp.repair, action: repair_ready, ref: mrp_repair_rmrp0}
-
I check that state is "Under Repair".
-
!assert {model: mrp.repair, id: mrp_repair_rmrp0}:
- state == 'under_repair'
-
Repairing Process for product is Done and I End Repair process by click on "End Repair" button.
-
!workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rmrp0}
-
I define invoiced after repair option in this Repair order.
so I create Invoice by click on "Make Invoice" wizard.
-
!record {model: mrp.repair.make_invoice, id: mrp_repair_make_invoice_0}:
group: 1
-
I click on "Create Invoice" button of this wizard to make invoice.
-
!python {model: mrp.repair.make_invoice}: |
self.make_invoices(cr, uid, [ref("mrp_repair_make_invoice_0")], {"active_ids": [ref("mrp_repair.mrp_repair_rmrp0")]})
-
I check that Invoice is created for this repair order.
-
!python {model: mrp.repair}: |
repair_id = self.browse(cr, uid, [ref('mrp_repair_rmrp0')], context=context)[0]
assert repair_id.invoice_id.id, _("No invoice exists for this repair order")