[FIX] web_kanban: fixed issues when having no column to display in kanban
[odoo/odoo.git] / addons / account_voucher / test / sales_receipt.yml
1 -
2   Accountant can also be created receipt and validate it there for I checked it with that user who is accountant.
3 -
4   !context
5     uid: 'res_users_account_voucher_user'
6
7   Creating a Voucher Receipt for partner Seagate with amount 30000.0
8
9   !record {model: account.voucher, id: account_voucher_seagate_0, view: view_sale_receipt_form}:
10     account_id: account.a_recv
11     amount: 30000.0
12     company_id: base.main_company
13     journal_id: account.sales_journal
14     line_cr_ids:
15       - account_id: account.a_sale
16         amount: 30000.0
17         type: cr
18     partner_id: base.res_partner_19
19     period_id: account.period_9
20     type: sale
21     
22 -
23   I check that the voucher state is Draft
24 -
25   !assert {model: account.voucher, id: account_voucher_seagate_0}:
26     - state == 'draft'
27
28 -
29   I click on post button to post the voucher
30 -
31   !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_seagate_0}
32
33 -
34   Check that the voucher state is Posted
35 -
36   !assert {model: account.voucher, id: account_voucher_seagate_0}:
37     - state == 'posted'
38     
39 -
40   I check that move lines are validated but not reconciled
41 -
42   !python {model: account.voucher}: |
43     reconciled = False
44     for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids: 
45        if l.reconcile_id:
46          reconciled = True
47          break
48     assert (not reconciled), "Found reconciled move lines, should not be"
49 -
50   I create and post a voucher payment of amount 30000.0 for the partner Seagate
51 -
52   !python {model: account.voucher}: |
53     vals = {}
54     journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
55     res = self.onchange_partner_id(cr, uid, [], ref("base.res_partner_19"), journal_id, 0.0, 1, ttype='receipt', date=False)
56     vals = {
57         'account_id': ref('account.cash'),
58         'amount': 30000.0,
59         'company_id': ref('base.main_company'),
60         'journal_id': ref('account.bank_journal'),
61         'partner_id': ref('base.res_partner_19'),
62         'period_id': ref('account.period_8'),
63         'type': 'receipt',
64     }
65     if not res['value']['line_cr_ids']:
66       res['value']['line_cr_ids'] = [{'type': 'cr', 'account_id': ref('account.a_recv'),}]
67     res['value']['line_cr_ids'][0]['amount'] = 30000.0
68     vals['line_cr_ids'] = [(0,0,i) for i in res['value']['line_cr_ids']]
69     id = self.create(cr, uid, vals)
70     voucher_id = self.browse(cr, uid, id)
71     assert (voucher_id.state=='draft'), "Voucher is not in draft state"
72     voucher_id.signal_workflow('proforma_voucher')
73 -
74   I check that move lines are reconciled meaning voucher is paid
75 -
76   !python {model: account.voucher}: |
77     reconciled = False
78     for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids: 
79        if l.reconcile_id:
80          reconciled = True
81          break
82     assert reconciled, "Found unreconciled move lines/unpaid voucher"