odoo/addons/mrp_repair/test/test_mrp_repair_noneinv.yml

29 lines
1.2 KiB
YAML

-
In order to test "mrp_repair" module, I start with confirm state, and start repair with giving the access rights of mrp user.
-
!context
uid: 'res_mrp_repair_user'
-
I confirm Repair order for Invoice Method 'No Invoice'.
-
!workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rmrp1}
-
I start the repairing process by clicking on "Start Repair" button for Invoice Method 'No Invoice'.
-
!workflow {model: mrp.repair, action: repair_ready, ref: mrp_repair_rmrp1}
-
I check its state which is in "Under Repair".
-
!assert {model: mrp.repair, id: mrp_repair_rmrp1}:
- state == 'under_repair'
-
Repairing process for product is in Done state and I end this process by clicking on "End Repair" button.
-
!workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rmrp1}
-
I define Invoice Method 'No Invoice' option in this repair order.
So, I check that Invoice has not been created for this repair order.
-
!python {model: mrp.repair}: |
repair_id = self.browse(cr, uid, [ref('mrp_repair_rmrp1')], context=context)[0]
assert not repair_id.invoice_id.id, "Invoice should not exist for this repair order"