~ubuntu-branches/ubuntu/quantal/openerp6.1/quantal

« back to all changes in this revision

Viewing changes to openerp/addons/account/test/account_cash_statement.yml

  • Committer: Package Import Robot
  • Author(s): Yolanda Robla
  • Date: 2012-09-20 15:29:00 UTC
  • Revision ID: package-import@ubuntu.com-20120920152900-woyy3yww8z6acmsk
Tags: upstream-6.1-1+dfsg
ImportĀ upstreamĀ versionĀ 6.1-1+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-
 
2
  In order to test Cash statement I create a Cash statement and confirm it and check it's move created
 
3
-
 
4
 !record {model: account.bank.statement, id: account_bank_statement_1}:
 
5
    date: !eval time.strftime('%Y-%m-%d')
 
6
    journal_id: account.cash_journal
 
7
    name: /
 
8
    period_id: account.period_10
 
9
    user_id: base.user_root
 
10
    starting_details_ids:
 
11
      -  pieces: 10.0
 
12
         number: 2
 
13
         subtotal: 20.0
 
14
      -  pieces: 100.0
 
15
         number: 1
 
16
         subtotal: 100.0
 
17
    balance_start: 120.0
 
18
    balance_end: 120.0
 
19
-
 
20
  I check that Initially bank statement is in the "Draft" state
 
21
-
 
22
  !assert {model: account.bank.statement, id: account_bank_statement_1}:
 
23
    - state == 'draft'
 
24
 
 
25
-
 
26
  I clicked on Open CashBox button to open the cashbox
 
27
-
 
28
 !python {model: account.bank.statement}: |
 
29
    self.button_open(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), })
 
30
 
 
31
-
 
32
  I check that now bank statement is in the "Open" state
 
33
-
 
34
  !assert {model: account.bank.statement, id: account_bank_statement_1}:
 
35
    - state == 'open'
 
36
 
 
37
-
 
38
  I enter values in Closing balance before close the cashbox
 
39
-
 
40
  !record {model: account.bank.statement, id: account_bank_statement_1}:
 
41
    line_ids:
 
42
      - account_id: account.a_recv
 
43
        amount: 1000.0
 
44
        date: !eval time.strftime('%Y-%m-%d')
 
45
        name: test
 
46
        partner_id: base.res_partner_4
 
47
        sequence: 0.0
 
48
        type: general
 
49
    balance_end: 1120.0
 
50
    ending_details_ids:
 
51
      -  pieces: 10.0
 
52
         number: 2
 
53
         subtotal: 20.0
 
54
      -  pieces: 100.0
 
55
         number: 1
 
56
         subtotal: 100.0
 
57
      -  pieces: 500.0
 
58
         number: 2
 
59
         subtotal: 1000.0
 
60
    balance_end_cash: 1120.0
 
61
 
 
62
-
 
63
  I clicked on Close CashBox button to close the cashbox
 
64
-
 
65
 !python {model: account.bank.statement}: |
 
66
      self.button_confirm_cash(cr, uid, [ref("account_bank_statement_1")], {"lang": "en_US", "tz": False, "active_model": "account.bank.statement", "active_ids": [ref("account_bank_statement_1")], "active_id": ref("account_bank_statement_1"), })
 
67
 
 
68
-
 
69
  I check that bank statement state is now "Closed"
 
70
-
 
71
  !assert {model: account.bank.statement, id: account_bank_statement_1}:
 
72
    - state == 'confirm'
 
73
 
 
74
-
 
75
  I check that move lines created for bank statement and move state is Posted
 
76
-
 
77
  !python {model: account.bank.statement}: |
 
78
    move_line_obj = self.pool.get('account.move.line')
 
79
    bank_data = self.browse(cr, uid, ref("account_bank_statement_1"))
 
80
    assert bank_data.move_line_ids, "Move lines not created for bank statement"
 
81
    for line in bank_data.move_line_ids:
 
82
      assert line.move_id.state == 'posted', "Move state is not posted"