Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
pospoint_of_saleowl18.0
1 Répondre
1568 Vues
Avatar
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
Avatar
Ignorer
Codesphere Tech

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

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Meilleure réponse
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
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Code patch not taking effect. Inheriting the POS invoice_button component
pos point_of_sale 18.0 l10n_mx
Avatar
Avatar
Avatar
2
oct. 25
3224
How to update point of sale order state?
pos point_of_sale
Avatar
Avatar
1
nov. 25
2442
POS Custom Promotion Popup: Confirm button not triggering applyPromotions()
pos 18.0
Avatar
Avatar
1
oct. 25
2005
Odoo 18: Price tags in Point of Sale (POS) Résolu
pos 18.0
Avatar
Avatar
Avatar
Avatar
Avatar
8
avr. 26
9201
How to print order bill and still have the possibility to make payment.
pos 18.0
Avatar
Avatar
Avatar
Avatar
Avatar
4
août 25
4140
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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