Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
rpcrpcjsonv14
1 Odpoveď
7578 Zobrazenia
Avatar
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
Avatar
Zrušiť
Avatar
Krys.Raj
Best Answer

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
Avatar
Zrušiť
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!

Registrácia
Related Posts Replies Zobrazenia Aktivita
rpc.query function in js not working when I am not logged in Solved
javascript rpc v14
Avatar
Avatar
2
apr 21
5346
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
Avatar
Avatar
1
feb 16
4744
JSONRPC - sales.order create - Issue with deliery_zone_id
delivery sale.order rpc rpcjson
Avatar
Avatar
2
júl 24
2529
How to get data to handle after call RPC in JavaScript
javascript rpc JavascriptCallFromOdoo v14
Avatar
Avatar
1
máj 23
8831
How to get POS Order json in Python upon Validate button of POS in session.(odoo14)
python rpc rpcjson JavascriptCallFromOdoo
Avatar
Avatar
1
sep 22
4674
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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