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
    • Artificial Intelligence
    • 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
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Property Management
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • 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
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

Can I overwrite the “Order” button on the PoS?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
pospoint_of_saleowl18.0
1 Atsakyti
1499 Rodiniai
Portretas
NELSON ALEXANDER DIAZ DE LA CRUZ

The goal is to customize the PoS interface so that the existing “Order” button (or a new adjacent button) can be overridden or extended to trigger a custom behavior: when the button is clicked, a popup window should open with a text input field. The cashier or waiter can type information such as the name of the person placing the order into this field. After entering the text and clicking “OK”, the popup should close and the order can then be confirmed as usual.


Odoo version: 18


0
Portretas
Atmesti
Codesphere Tech

Hello,
You can use kitchen note or customer note for this. Is it not feasible for you?

Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer
Hi,
You need to do three things:
      1- Create a custom popup (text input)
      2- Extend the Order/Validate button behavior
      3- Store the entered text on the POS order

* Create a custom popup (Text Input)
--> static/src/js/OrderNamePopup.js

import { AbstractAwaitablePopup } from "@point_of_sale/app/popup/abstract_awaitable_popup";
import { registry } from "@web/core/registry";

export class OrderNamePopup extends AbstractAwaitablePopup {
    setup() {
        super.setup();
        this.orderName = "";
    }

    confirm() {
        this.resolve({ confirmed: true, value: this.orderName });
    }

    cancel() {
        this.resolve({ confirmed: false });
    }
}

OrderNamePopup.template = "OrderNamePopup";

registry.category("popups").add("OrderNamePopup", OrderNamePopup);

--> static/src/xml/OrderNamePopup.xml

<?xml version="1.0" encoding="UTF-8"?>
<templates>
    <t t-name="OrderNamePopup" owl="1">
        <div class="popup popup-textinput">
            <div class="title">Enter Order Name</div>

            <input type="text"
                   class="form-control"
                   t-model="orderName"
                   placeholder="Customer / Order Name"/>

            <div class="footer">
                <button class="button cancel" t-on-click="cancel">Cancel</button>
                <button class="button confirm" t-on-click="confirm">OK</button>
            </div>
        </div>
    </t>
</templates>

* Extend the “Order / Validate” button
--> static/src/js/PaymentScreenPatch.js

import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen";
import { patch } from "@web/core/utils/patch";

patch(PaymentScreen.prototype, "order_name_popup", {

    async validateOrder(isForceValidate) {
        const order = this.currentOrder;

        // Show popup ONLY if name not already set
        if (!order.order_name) {
            const { confirmed, value } = await this.popup.add(
                "OrderNamePopup",
                {}
            );

            if (!confirmed) {
                return; // stop validation
            }

            order.order_name = value;
        }

        // Continue normal validation
        await super.validateOrder(isForceValidate);
    },
});

* Store the value on the POS Order
--> static/src/js/OrderExtension.js

import { Order } from "@point_of_sale/app/store/models";
import { patch } from "@web/core/utils/patch";

patch(Order.prototype, "order_name_field", {

    setup() {
        super.setup(...arguments);
        this.order_name = this.order_name || "";
    },

    export_for_printing() {
        const data = super.export_for_printing(...arguments);
        data.order_name = this.order_name;
        return data;
    },

    export_as_JSON() {
        const json = super.export_as_JSON(...arguments);
        json.order_name = this.order_name;
        return json;
    },

    init_from_JSON(json) {
        super.init_from_JSON(...arguments);
        this.order_name = json.order_name || "";
    },
});

Manifest:

'assets': {
    'point_of_sale.assets': [
        'your_module/static/src/js/*.js',
        'your_module/static/src/xml/*.xml',
    ],
},


Hope it helps.

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
Code patch not taking effect. Inheriting the POS invoice_button component
pos point_of_sale 18.0 l10n_mx
Portretas
Portretas
Portretas
2
spal. 25
3178
How to update point of sale order state?
pos point_of_sale
Portretas
Portretas
1
lapkr. 25
2349
POS Custom Promotion Popup: Confirm button not triggering applyPromotions()
pos 18.0
Portretas
Portretas
1
spal. 25
1963
Odoo 18: Price tags in Point of Sale (POS) Solved
pos 18.0
Portretas
Portretas
Portretas
Portretas
Portretas
8
bal. 26
9171
How to print order bill and still have the possibility to make payment.
pos 18.0
Portretas
Portretas
Portretas
Portretas
Portretas
4
rugp. 25
4083
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 Svenska ภาษาไทย 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