Hi there,
I have been trying to register an invoice payment through OpenERP. I have been able to manually create and approve the invoice, the voucher and its line
I'm currently creating the voucher using this information:
def create_voucher(name, amount, journal_id, account_id,
period_id, partner_id, move_id):
model = 'account.voucher'
r = {
'name': name,
'amount': amount,
'journal_id': journal_id,
'account_id': account_id,
'period_id': period_id,
'partner_id': partner_id,
'type': 'receipt',
# Colocar move_id
'move_id': move_id
}
# executing XMLRPC stuff
And im creating voucher lines with this info
def create_voucher_line(name, amount, voucher_id, partner_id, account_id):
model = 'account.voucher.line'
r = {
'name': name,
'payment_option': 'without_writeoff',
'amount': amount,
'voucher_id': voucher_id,
'partner_id': partner_id,
'account_id': account_id,
#'move_id': move_id
#'amount': 0,
#'type': 'cr'
}
# executing XMLRPC stuff
I can successfully see the voucher record and it's lines but this is where I may be wrong. How do I register that voucher into an invoice payment?? I have tried to use proforma voucher with no success
db_conn.exec_workflow('mydb', 1, 'admin', 'account.voucher', 'proforma_voucher', voucher_id)
If I'm successfully creating a voucher and it's lines, what would be the final step to register that as a payment??
Thanks a lot for your help
jhv
I've added an (I think) simple-to-follow answer here: https://www.odoo.com/forum/help-1/question/how-to-apply-payment-to-invoice-via-xml-rpc-37795#answer_93799