Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Documentation about "web.rpc" direct on front (Website app)

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
rpcrpcjsonv14
1 Răspunde
7577 Vizualizări
Imagine profil
Rafael Ramírez

I want to directly modify the website application in odoo 14. I am using web.rpc for this, in this way but I cannot find documentation to do a more refined search.


odoo.define("website.user_custom_code", function (require) {


;("use strict")
require("web.dom_ready")
rpc = require("web.rpc")

const model = "product.template"
const method = "search_read"

// Use an empty array to search for all the records
const domain = ["fields_get"]
// Use an empty array to read all the fields of the records
const fields = [] //accessoADatos.map(x => x.campo)

const options = {
model,
method,
args: [domain, fields],

}

rpc
.query(options)
.then(products => console.log(products))
.catch(err => console.error(err))
})





1
Imagine profil
Abandonează
Imagine profil
Krys.Raj
Cel mai bun răspuns

Hello Rafael,
web.rpc is just the wrapped by odoo web client ajax.rpc() call :)
so to help you, please take a look at the source of this js module:

https://github.com/odoo/odoo/blob/14.0/addons/web/static/src/js/core/rpc.js

take a look at the line 18:

return ajax.rpc(query.route, query.params, options);

you see exactly what parameters to use and that it is using js ajax call..

For the one of the easiest example of use, just analyze this usage from website_sale_shop_mail.js:

https://github.com/odoo/odoo/blob/14.0/addons/website_sale/static/tests/tours/website_sale_shop_mail.js

Hope this helped something..
if it did please vote +1 👍
and if you find it Best answer - make it so 😎

1
Imagine profil
Abandonează
Rafael Ramírez
Autor

It is useful, but I realize that my problem is that I do not know how to access the models by name. For example, I can access `product.template`, but I have a boocking module that adds extra media fields. (A downloaded plugin) How to obtain the model to consult ?.

Krys.Raj

Is this module introducing it's own model or just inheriting existing one.. you always should access the table in which you have the field.. if this module is inheritng product.template and adding field to it, to get it's value you need to access product.template, otherwise you need to access newly created model (table) let's call it custom.model

Krys.Raj

if you are asking, where to find the model name and all fields in it you can do it from the source code (look at lines since 12-22)
https://github.com/odoo/odoo/blob/14.0/addons/website_sale/models/product.py

or by going to Settings -> Technical -> Models -> find your model name and description -> click -> and there you have your fields

Rafael Ramírez
Autor

I am looking for this data in the product, but it seems to be in product.image? How do I get the url of the video?
https://imgur.com/a/6iMMo8O

Krys.Raj

be sure you have developer mode activated (Settings -> Developer tools -> bottom page)
or just add ?debug=1 in the url of you browser right after /web
then if you hover the bolded url, you will find the popup with details of this field

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
rpc.query function in js not working when I am not logged in Rezolvat
javascript rpc v14
Imagine profil
Imagine profil
2
apr. 21
5345
How can I notify a external system (via a XMLRPC call ou via a URL call) about the validation of an invoice.
integration rpc rpcjson
Imagine profil
Imagine profil
1
feb. 16
4743
JSONRPC - sales.order create - Issue with deliery_zone_id
delivery sale.order rpc rpcjson
Imagine profil
Imagine profil
2
iul. 24
2528
How to get data to handle after call RPC in JavaScript
javascript rpc JavascriptCallFromOdoo v14
Imagine profil
Imagine profil
1
mai 23
8831
How to get POS Order json in Python upon Validate button of POS in session.(odoo14)
python rpc rpcjson JavascriptCallFromOdoo
Imagine profil
Imagine profil
1
sept. 22
4673
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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