~camptocamp/account-invoicing/correct_payment_term_balance_mdh

« back to all changes in this revision

Viewing changes to account_invoice_zero/test/account_invoice_zero_paid.yml

  • Committer: Yannick Vaucher
  • Author(s): guewen.baconnier at camptocamp
  • Date: 2014-03-14 10:00:13 UTC
  • mfrom: (40.1.2 7.0-account_invoice_zero)
  • Revision ID: yannick.vaucher@camptocamp.com-20140314100013-gdib2fjpl1b0o82i
[ADD] account_invoice_zero module

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-
 
2
  In order to test that an invoice with a zero amount is directly paid, I create an invoice
 
3
-
 
4
  !record {model: account.invoice, id: account_invoice_zero_paid}:
 
5
    account_id: account.a_recv
 
6
    company_id: base.main_company
 
7
    currency_id: base.EUR
 
8
    invoice_line:
 
9
      - account_id: account.a_sale
 
10
        name: '[PCSC234] PC Assemble SC234'
 
11
        price_unit: 120.0
 
12
        quantity: 1.0
 
13
        product_id: product.product_product_3
 
14
        uos_id: product.product_uom_unit
 
15
      - account_id: account.a_sale
 
16
        name: discount
 
17
        price_unit: -120.0
 
18
        quantity: 1.0
 
19
        uos_id: product.product_uom_unit
 
20
    journal_id: account.bank_journal
 
21
    partner_id: base.res_partner_12
 
22
    reference_type: none
 
23
-
 
24
  I check that Initially customer invoice state is "Draft"
 
25
-
 
26
  !assert {model: account.invoice, id: account_invoice_zero_paid}:
 
27
    - state == 'draft'
 
28
-
 
29
  I called the "Confirm Draft Invoices" wizard
 
30
-
 
31
  !record {model: account.invoice.confirm, id: account_invoice_confirm_0}:
 
32
    {}
 
33
-
 
34
  I clicked on Confirm Invoices Button
 
35
-
 
36
  !python {model: account.invoice.confirm}: |
 
37
    self.invoice_confirm(cr, uid, [ref("account_invoice_confirm_0")], {"lang": 'en_US',
 
38
      "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_zero_paid")],
 
39
      "type": "out_invoice", "active_id": ref("account_invoice_zero_paid"), })
 
40
-
 
41
  I check that customer invoice state is "Paid"
 
42
-
 
43
  !assert {model: account.invoice, id: account_invoice_zero_paid}:
 
44
    - state == 'paid'