you can use the message_post method of the stock.picking model. Here's an example of how you can construct the JSON-RPC request:
{
"id": 12,
"jsonrpc": "2.0",
"method": "call",
"params": {
"model": "stock.picking",
"method": "message_post",
"args": [
32, // thread_id
"Test", // body (your log note content)
false, // subtype_xmlid (mail.mt_note) - You can set to false to use the default value
false, // parent_id (you can set it to false)
false, // attachment_ids (you can set it to false or an empty list [])
false, // partner_ids (you can set it to false or an empty list [])
false, // attachment_tokens (you can set it to false or an empty list [])
false // partner_emails (you can set it to false or an empty list [])
],
"kwargs": {
"context": {
"mail_post_autofollow": false,
"temporary_id": "523.01"
}
}
}
}
Explanation of parameters:
- model: The model name ("stock.picking" in this case).
- method: The method name ("message_post" to add a new LogNote).
- args: A list of arguments for the method. Here, you pass the thread_id of the Order Delivery, the log note content ("Test" in this case), and other optional parameters (you can set them to false or an empty list []).
- kwargs: Additional keyword arguments. Here, you pass the context, which can include some context variables like mail_post_autofollow and temporary_id.
You can make this JSON-RPC request to the Odoo server using your preferred HTTP client library, such as requests in Python or axios in JavaScript. Make sure to replace 32 in the args with the actual thread_id of your Order Delivery. After sending the request, a new LogNote with the specified content will be added to the Order Delivery.