Hello, i'm trying to send email of an invoice in python but i have some problems...
First, i have already created an invoice and confirmed it.
After i try to send it using account invoice send like that but got an error :
Code : models.execute_kw(db, uid, password, 'account.invoice.send' 'send_and_print_action', [[mail_id]],{})
Error :
Fault 2 Record deleted or record not exist
So i tried to create a ''account.invoice.send' but got an error too :
Code : models.execute_kw(db, uid, password, 'account.invoice.send', 'create', [
{'res_id': invoice[0]['id'],
'is_email': True,
'invoice_without_email': False,
'is_print': False,
'printed': False,
'move_types': False,
'invoice_ids': [(34, 0, vals)],
'partner_ids': invoice[0]['partner_id'],
'composition_mode': "comment",
'template_id': mail_template,
'subject': invoice[0]["company_id"][1] + " - Facture",
'attachment_ids': invoice[0]["attachment_ids"]
}])
Error :
Fault 2 You can only send invoices
Thank your for your help !