Skip to Content

Telegram Bot for Odoo

A private Telegram bot for your team: check sales and stock, approve purchases and update Odoo from your phone.

TWO-WAY

Ask Odoo, approve and update, all from Telegram

A notification tells you something happened. A bot lets you act on it: check figures, approve requests and record updates without opening a laptop.

  • Approve or reject with one tap
  • Quick answers to everyday questions
  • Every action recorded on the Odoo document
/sales today
πŸ“ˆ Sales today
14 orders Β· 312,400 BDT
Best: Rahman Traders (48,500)
🧾 Purchase P00016 needs approval
Azure Interior Β· 189.75 USD
Requested by Imran
βœ… Approve❌ Reject
βœ… Approve
Done. P00016 is approved and noted in Odoo.
/stock A4 Paper
πŸ“¦ A4 Paper Box: 12 in Main Warehouse, 40 in Branch 2
WHAT YOUR TEAM CAN DO

Example commands

Commands are designed around your business; these are typical ones.

/sales todayOrders and revenue for today, this week or this month
/stock <product>Quantity on hand in each warehouse
/order S00482Status, delivery and payment of an order
/dueCustomers with overdue invoices
/approvePurchases and expenses waiting for your approval, with buttons
HOW IT IS IMPLEMENTED

Bot, rules and Odoo actions

  1. Create your company bot

    @BotFather in Telegram creates the bot, its name and picture, and the list of commands shown in the menu. The bot token is stored encrypted in n8n.

  2. Decide who may use it

    Each Telegram account is linked to an Odoo user and a role. Messages from anyone else are ignored, each person sees only the commands for their role (for example, only managers get approvals), and their name is written on every action.

    n8n Code node: allowed users
    // Telegram user id β†’ Odoo user id
    const ALLOWED = { 123456789: 2, 987654321: 7 };
    const u = $json.message?.from ?? $json.callback_query?.from;
    const odooUser = ALLOWED[u?.id];
    if (!odooUser) return [];                      // strangers get no answer at all
    const text = $json.message?.text ?? '';
    const [command, ...args] = text.trim().split(/\s+/);
    return [{ json: {
      chatId: ($json.message ?? $json.callback_query.message).chat.id,
      odooUser,
      command: $json.callback_query ? 'button' : command,
      args: args.join(' '),
      data: $json.callback_query?.data,         // e.g. "po:approve:16"
    } }];
  3. Answer questions from Odoo

    Each command reads Odoo through its API and replies in a short message, for example today's confirmed sales:

    POST /json/2/sale.order/search_read
    {
      "domain": [["state", "=", "sale"], ["date_order", ">=", "2026-11-20 18:00:00"]],
      "fields": ["name", "partner_id", "amount_total"]
    }

    Odoo stores times in UTC; the workflow converts "today" in your time zone before asking.

  4. Approve with a button

    Requests waiting for approval are sent with Approve and Reject buttons. A tap calls the same Odoo action as the button on the screen, then writes who approved it on the document.

    Message with buttons (Telegram Bot API)
    {
      "chat_id": 123456789,
      "text": "🧾 Purchase P00016 needs approval\nAzure Interior · 189.75 USD",
      "reply_markup": { "inline_keyboard": [[
        { "text": "βœ… Approve", "callback_data": "po:approve:16" },
        { "text": "❌ Reject",  "callback_data": "po:reject:16" }
      ]] }
    }
    What the tap does in Odoo
    POST /json/2/purchase.order/button_approve
    { "ids": [16] }
    
    POST /json/2/purchase.order/message_post
    { "ids": [16], "body": "Approved on Telegram by Nadia Rahman", "subtype_xmlid": "mail.mt_note" }
    Odoo Β· Purchase
    Odoo purchase order confirmed, with a note that it was approved on Telegram
    The purchase order in Odoo after the tap: confirmed, with a note saying who approved it on Telegram.
  5. Put it together in n8n

    One workflow receives every message, checks the user, and routes each command to its own short branch.

    n8n Β· Telegram bot for Odoo
    n8n workflow of the Telegram bot: trigger, user check, command router and four branches
    The bot in n8n: check the user, route the command, then read from or act in Odoo and reply.
πŸ”
Only your people, only their rights

Each Telegram account is linked to an Odoo user and a role, the bot ignores everyone else, and every action is recorded on the Odoo document with the person's name.

HOW YOU BENEFIT

Decisions don't wait for the office

βœ…Approvals in seconds

Purchases and expenses are not stuck while a manager is travelling.

πŸ“ŠAnswers on demand

Sales and stock figures without logging in or calling the office.

🧾Nothing lost

Every action from Telegram is written on the Odoo document.

QUESTIONS

Common questions

Can customers use the bot too?

Yes, for example to check an order status, with a separate list of what customers may ask. Staff commands stay private.

What if a phone is lost?

Remove that Telegram account from the allowed list in n8n; it stops working immediately.

Does it need a custom Odoo module?

No. It uses Odoo's standard API and the same actions as the buttons in Odoo.