+-
+ I test sales payment with user who is accountant.
+-
+ !context
+ uid: 'res_users_account_voucher_user'
-
Create an invoice for the partner Seagate with amount 450.0
-
I will create and post an account voucher of amount 450.0 for the partner Seagate.
-
!python {model: account.voucher}: |
- import netsvc
vals = {}
journal_id = self.default_get(cr, uid, ['journal_id']).get('journal_id',None)
voucher = self.recompute_voucher_lines(cr, uid, [], ref("base.res_partner_19"), journal_id, 450.0, ref('base.EUR'), 'receipt', False)
voucher_id = self.browse(cr, uid, id)
assert (voucher_id.writeoff_amount == 0.0), "Writeoff amount is not 0.0"
assert (voucher_id.state=='draft'), "Voucher is not in draft state"
- wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'account.voucher', voucher_id.id, 'proforma_voucher', cr)
+ self.signal_proforma_voucher(cr, uid, [voucher_id.id])
-
Finally i will Confirm the state of the invoice is paid