I'm trying to send an email with sign request with API XMLM/RPC in Python client
For this, I implement 5 calls to the API:
1. Upload file with Method sign.template and method upload_template, send the PDF file and got the Document ID
2. Update contract sign, update pdf file with the field or fields to fill with user data (name, company sign..).
3. Create the email request with message data (receiver, pdf file, text message).
4. Some method required to check the email before send:
Model sign.send.request method: read, and Model sign.send.request.signer method read
5. Send email with model sign.send.request and method send_request with args the email template created before, like this:
request_sign = api.execute_kw(database, uid, api_key, "sign.send.request","send_request", [template_email_id])
template created before, like this: All steps executes well, but the last one gives me this:
xmlrpc.client.Fault:
...
line 534, in dump_nil\n raise TypeError("cannot marshal None unless allow_none is enabled")\nTypeError: cannot marshal None unless allow_none is enabled\n'>
I declare the connection with allow_none = True:
api = client.ServerProxy("%s/xmlrpc/2/object" % self.url, allow_none=True)
I don't know what Am I doing wrong with the method call.
Thank you for your answers.
I migrate the code to use OdooRPC module and can prepare the email to send later.
# Prepare email request
sign_email =self.odoo.env['sign.send.request']
email_id = sign_email.create(request_fields)
request_sign = sign_email.send_request(email_id)
The email is created in Odoo but is not delivered to the recipients.
You have to setup your Outgoing Mail Server