Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
5393 Näkymät

Hello odoo community :)

I need some hints how to send an email to an customer using xmlrpc on python.

I've sucessfully created the the invoice and changed the state to open via:


saleOrderId = models.execute(database, uid, password, 'sale.order', 'create', {'partner_id': 957})

InvoiceIds = models.execute(database, uid, password, 'sale.order', 'action_invoice_create', [saleOrderId])

models.execute(database, uid, password, 'account.invoice', 'action_invoice_open', InvoiceIds)


but now I'm stucking on how to create and send the invoice to the customer.


Thank you

Avatar
Hylkää

guys, tell me if you found a way to send invoice via xmlrpc, especially with ripcord in PHP.. thanks

Tekijä

Thank you for your answer. Is there an example how to compose an account invoice email with attachment and text and send this via xmlrpc?

Paras vastaus

Marc,

You may smartly use the 'send_mail' method of the code module by calling that method from xmlrpc. Sale Order and Invoice have already the similar functionality. Here you have to bypass what the wizard does.

Simply, pass the info to the mail.compose.message model's send_mail method with the right context value.

All the best.

Thanks.


Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
lokak. 17
5658
3
elok. 17
5717
2
helmik. 24
5278
0
toukok. 23
2221
1
huhtik. 23
7480