Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How to update point of sale order state?

Odebírat

Get notified when there's activity on this post

This question has been flagged
pospoint_of_sale
1 Odpovědět
265 Zobrazení
Avatar
qwen

I'm using odoo18 . In my custom pos module when call api canceled the order. The order state is cancel in database. But the pos ui when select tickets the order still paid . After refresh the data it's gone.

Thanks for help!


My code:

await this.pos.data.call(
'pos.order',
'cancel_payment',
[[this.currentOrder.id]],
);
const updatedOrders = await this.pos.data.searchRead("pos.order", [["id", "=", this.currentOrder.id]]);
if (updatedOrders.length > 0) {
const serverOrder = updatedOrders[0];
let order = this.pos.models["pos.order"].get(this.currentOrder.id);
order.state = serverOrder.state;
order.is_paying = false;
order.setScreenData({name: ""});
order.uiState.locked = true;
// I'm using this to update local order state , this not working.
this.pos.models["pos.order"].update(order, {'state': order.state});
}
// To new order
if (!this.pos.config.module_pos_restaurant) {
this.pos.selectedOrderUuid = this.pos.getEmptyOrder().uuid;
}
this.pos.searchProductWord = "";
const nextPage = this.pos.defaultPage;
this.pos.navigate(nextPage.page, nextPage.params);
0
Avatar
Zrušit
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

Hi,


Try the following,

1- After canceling the order via API, trigger a full re-fetch of POS orders using the built-in POS data loader:


await this.pos.loadNewOrders();

this.pos.showScreen("TicketScreen");


This ensures the local cache is fully updated.


2- Alternatively, remove the canceled order from the frontend manually:


this.pos.models["pos.order"].remove(this.currentOrder.id);

this.pos.showScreen("TicketScreen");


3- Avoid manually patching order.state unless you also handle re-render logic — the POS frontend isn’t reactive like Odoo web views.


In short, the issue isn’t with your backend logic but with the POS frontend not refreshing its in-memory order list. The clean solution is to reload or remove the order in the POS UI after the cancellation API call, ensuring the interface matches the database state instantly.



Hope it helps

0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Pos product shows 0.0 units sold
pos point_of_sale
Avatar
Avatar
Avatar
3
dub 25
1837
How to have checkboxes for the variables of each product
pos point_of_sale
Avatar
Avatar
1
srp 24
2923
How to delete POS Sessions! Odoo 16 Vyřešeno
pos point_of_sale
Avatar
Avatar
Avatar
Avatar
3
kvě 24
12906
POS Session wont close Vyřešeno
pos point_of_sale
Avatar
Avatar
1
zář 23
4581
Odoo POS: paiement partiel et monnaie
pos point_of_sale
Avatar
0
srp 23
2420
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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