{
  "id": "g9L52eIw9UtmEKlk",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Send Log Message to Odoo",
  "tags": [],
  "nodes": [
    {
      "id": "aec2c855-0861-4757-a43e-2729d63973ea",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "rec_id",
              "type": "number"
            },
            {
              "name": "message"
            },
            {
              "name": "model"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "30a07404-6aa2-4ea4-9edc-e558d551f611",
      "name": "Odoo",
      "type": "n8n-nodes-base.odoo",
      "position": [
        220,
        0
      ],
      "parameters": {
        "resource": "custom",
        "customResource": "={{ 'mail.message' }}",
        "fieldsToCreateOrUpdate": {
          "fields": [
            {
              "fieldName": "message_type",
              "fieldValue": "comment"
            },
            {
              "fieldName": "model",
              "fieldValue": "={{ $json.model }}"
            },
            {
              "fieldName": "res_id",
              "fieldValue": "={{ $json.rec_id }}"
            },
            {
              "fieldName": "body",
              "fieldValue": "={{ $json.message }}"
            }
          ]
        }
      },
      "credentials": {
        "odooApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b5c95ef2-66a7-4706-9ffb-9359133c889e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -580,
        -60
      ],
      "parameters": {
        "color": 6,
        "width": 400,
        "height": 260,
        "content": "## Creates a Note in an Odoo Record\nThis sub-workflow receives data from a main workflow (for example, a record ID, a message, and the Odoo model) and creates a new note (or comment) in the corresponding Odoo record. Essentially, it acts as a centralized point for logging comments or notes in a specific Odoo model, ensuring that the information remains organized and easy to track."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "timezone": "America/Mexico_City",
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1",
    "executionTimeout": -1
  },
  "versionId": "0e263156-7239-4470-b8ad-2e46f832b74a",
  "connections": {
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Odoo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}