2 Accountant can also be created receipt and validate it there for I checked it with that user who is accountant.
5 uid: 'res_users_account_voucher_user'
7 Creating a Voucher Receipt for partner Seagate with amount 30000.0
9 !record {model: account.voucher, id: account_voucher_seagate_0, view: view_sale_receipt_form}:
10 account_id: account.a_recv
12 company_id: base.main_company
13 journal_id: account.sales_journal
15 - account_id: account.a_sale
18 partner_id: base.res_partner_19
19 period_id: account.period_9
23 I check that the voucher state is Draft
25 !assert {model: account.voucher, id: account_voucher_seagate_0}:
29 I click on post button to post the voucher
31 !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_seagate_0}
34 Check that the voucher state is Posted
36 !assert {model: account.voucher, id: account_voucher_seagate_0}:
40 I check that move lines are validated but not reconciled
42 !python {model: account.voucher}: |
44 for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids:
48 assert (not reconciled), "Found reconciled move lines, should not be"
50 I create and post a voucher payment of amount 30000.0 for the partner Seagate
52 !python {model: account.voucher}: |
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)
57 'account_id': ref('account.cash'),
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'),
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')
74 I check that move lines are reconciled meaning voucher is paid
76 !python {model: account.voucher}: |
78 for l in self.browse(cr, uid, [ref("account_voucher_seagate_0")])[0].move_ids:
82 assert reconciled, "Found unreconciled move lines/unpaid voucher"