[FIX] tour.js: tour shop
[odoo/odoo.git] / addons / mrp_repair / test / test_mrp_repair_afterinv.yml
1 -
2   In order to test Invoice Method 'After Repair' with giving the access rights of mrp user.
3 -
4   !context
5     uid: 'res_mrp_repair_user'
6 -
7   I confirm Repair order taking Invoice Method 'After Repair'.
8 -
9   !workflow {model: mrp.repair, action: repair_confirm, ref: mrp_repair_rmrp0}
10 -
11   I start the Repairing process by clicking on "Start Repair" button for Invoice Method 'After Repair'.
12 -
13   !workflow {model: mrp.repair, action: repair_ready, ref: mrp_repair_rmrp0}
14 -
15   I check the state is in "Under Repair".
16 -
17   !assert {model: mrp.repair, id: mrp_repair_rmrp0}:
18       - state == 'under_repair'
19 -
20   Repairing process for product is in Done state and I end Repair process by clicking on "End Repair" button.
21 -
22   !workflow {model: mrp.repair, action: action_repair_end, ref: mrp_repair_rmrp0}
23 -
24   I define Invoice Method 'After Repair' option in this Repair order.
25   so I create invoice by clicking on "Make Invoice" wizard.
26 -
27   !record {model: mrp.repair.make_invoice, id: mrp_repair_make_invoice_0}:
28     group: 1
29 -
30   I click on "Create Invoice" button of this wizard to make invoice.
31 -
32   !python {model: mrp.repair.make_invoice}: |
33     self.make_invoices(cr, uid, [ref("mrp_repair_make_invoice_0")], {"active_ids": [ref("mrp_repair.mrp_repair_rmrp0")]})
34 -
35   I check that invoice is created for this Repair order.
36 -
37   !python {model: mrp.repair}: |
38      repair_id = self.browse(cr, uid, [ref('mrp_repair_rmrp0')], context=context)[0]
39      assert repair_id.invoice_id.id, "No invoice exists for this repair order"