2011-09-25 17:04:16 +00:00
|
|
|
-
|
2012-08-16 08:42:24 +00:00
|
|
|
I create a new PoS order with 2 units of PC1 at 450 EUR (Tax Incl) and 3 units of PCSC349 at 300 EUR. (Tax Excl)
|
2011-09-25 17:04:16 +00:00
|
|
|
-
|
|
|
|
!record {model: pos.order, id: pos_order_pos1}:
|
|
|
|
company_id: base.main_company
|
2012-06-19 07:16:24 +00:00
|
|
|
partner_id: base.res_partner_1
|
2011-09-25 17:04:16 +00:00
|
|
|
lines:
|
|
|
|
- name: OL/0001
|
2012-06-29 11:04:24 +00:00
|
|
|
product_id: product.product_product_3
|
2011-09-25 17:04:16 +00:00
|
|
|
price_unit: 450
|
|
|
|
discount: 5.0
|
|
|
|
qty: 2.0
|
|
|
|
- name: OL/0002
|
2012-06-29 11:04:24 +00:00
|
|
|
product_id: product.product_product_4
|
2011-09-25 17:04:16 +00:00
|
|
|
price_unit: 300
|
|
|
|
discount: 5.0
|
|
|
|
qty: 3.0
|
|
|
|
-
|
|
|
|
I click on the "Make Payment" wizard to pay the PoS order
|
|
|
|
-
|
2011-11-17 10:05:44 +00:00
|
|
|
!record {model: pos.make.payment, id: pos_make_payment_2, context: '{"active_id": ref("pos_order_pos1"), "active_ids": [ref("pos_order_pos1")]}' }:
|
2011-09-25 17:04:16 +00:00
|
|
|
amount: !eval >
|
|
|
|
(450*2 + 300*3*1.05)*0.95
|
|
|
|
-
|
|
|
|
I click on the validate button to register the payment.
|
|
|
|
-
|
|
|
|
!python {model: pos.make.payment}: |
|
|
|
|
self.check(cr, uid, [ref('pos_make_payment_2')], context={'active_id': ref('pos_order_pos1')} )
|
|
|
|
- |
|
|
|
|
I check that the order is marked as paid and there is no invoice attached to it
|
|
|
|
-
|
|
|
|
!python {model: pos.order}: |
|
|
|
|
order = self.browse(cr,uid,ref('pos_order_pos1'))
|
|
|
|
-
|
|
|
|
!assert {model: pos.order, id: pos_order_pos1, string: State not correct}:
|
|
|
|
- state == 'paid'
|
|
|
|
- not invoice_id
|
|
|
|
-
|
|
|
|
I generate the invoice by pressing the Invoice button that calls the workflow
|
|
|
|
-
|
|
|
|
!workflow {model: pos.order, action: invoice, ref: pos_order_pos1}
|
|
|
|
-
|
|
|
|
I test that the total of the attached invoice is correct
|
|
|
|
-
|
|
|
|
!assert {model: pos.order, id: pos_order_pos1, string: Invoice not correct}:
|
2012-03-13 13:39:56 +00:00
|
|
|
- amount_total == (450*2 + 300*3*1.05)*0.95
|