2 I create a new PoS order with 2 units of PC1 at 450 EUR (Tax Incl) and 3 units of PC2 at 300 EUR. (Tax Excl)
4 !record {model: pos.order, id: pos_order_pos1}:
5 company_id: base.main_company
6 partner_id: base.res_partner_asus
9 product_id: product.product_product_pc1
14 product_id: product.product_product_pc2
19 I click on the "Make Payment" wizard to pay the PoS order
21 !record {model: pos.make.payment, id: pos_make_payment_2, context: {'active_id': ref('pos_order_pos1'), 'active_ids': [ref('pos_order_pos1')]} }:
23 (450*2 + 300*3*1.05)*0.95
25 I click on the validate button to register the payment.
27 !python {model: pos.make.payment}: |
28 self.check(cr, uid, [ref('pos_make_payment_2')], context={'active_id': ref('pos_order_pos1')} )
30 I check that the order is marked as paid and there is no invoice attached to it
32 !python {model: pos.order}: |
33 order = self.browse(cr,uid,ref('pos_order_pos1'))
35 !assert {model: pos.order, id: pos_order_pos1, string: State not correct}:
39 I generate the invoice by pressing the Invoice button that calls the workflow
41 !workflow {model: pos.order, action: invoice, ref: pos_order_pos1}
43 I test that the total of the attached invoice is correct
45 !assert {model: pos.order, id: pos_order_pos1, string: Invoice not correct}:
47 - invoice_id.amount_total == (450*2 + 300*3*1.05)*0.95