Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Add LogNote to Order Delivery using JSON-RPC

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
pythonjsonrpcodoo16features
3 Replies
4214 Rodiniai
Portretas
John Doe

Hello,

I'm trying to add a new LogNote to my Order Delivery via JSON-RPC but I can't seem to get it. Can anyone show me how to do it?

The following is the raw request made by the platform which I'm using as reference:

{"id":12,
"jsonrpc":"2.0",
"method":"call",
"params":{
	​"context":{
	​	​"mail_post_autofollow":false,
	​	​"temporary_id":523.01},
	​	​"post_data":{
	​	​	​"body":"Test",
	​	​	​"attachment_ids":[],
	​	​	​"attachment_tokens":[],
	​	​	​"message_type":"comment",
	​	​	​"partner_ids":[],
	​	​	​"subtype_xmlid":"mail.mt_note",
	​	​	​"partner_emails":[]},
	​"thread_id":32,
	​"thread_model":"stock.picking"}
}


Best regards,
0
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,
Refer the code to add lognotes in stock.picking

notes = '%s' % '' + str(request.jsonrequest['inventoryMode']) + " - " + str(
request.jsonrequest['inventoryState']) + '' + '
'
+ ' Market: ' + str(
request.jsonrequest['location']) + '
'
+ ' Device date time: ' + str(
request.jsonrequest['deviceDateTime']) + '
'
+ str(request.jsonrequest['description'])

log_note = request.env['mail.message'].sudo().create({
'res_id': market.id,
'body': notes,
'model': 'stock.picking',
'email_from': request.jsonrequest['email'],
'attachment_ids': data,
})


Hope it helps you

0
Portretas
Atmesti
Portretas
shubham shiroya
Best Answer

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.

0
Portretas
Atmesti
Portretas
Axel Mendoza
Best Answer

Try to call message_post of the stock.picking​ model with the values of the post_data that shows on the example request you have

0
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
bom creation via jsonrpc order of operations Solved
python jsonrpc odoo16features
Portretas
Portretas
1
saus. 23
4758
How to solve error 'numpy' has no attribute 'float' in Python
python odoo16features
Portretas
Portretas
Portretas
3
vas. 23
6338
product.template form name doesnt update Solved
jsonrpc Docker odoo16features
Portretas
Portretas
Portretas
Portretas
3
lapkr. 24
3862
Partner Ledger customize
accounting python odoo16features
Portretas
Portretas
1
vas. 24
2658
Error while generating a report in python (Record does not exist or has been deleted) Solved
python report odoo16features
Portretas
Portretas
Portretas
2
geg. 23
4237
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now