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í
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • 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
    • Služby pro partnery
    • 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

Popup window in pos

Odebírat

Get notified when there's activity on this post

This question has been flagged
javascriptposodoo10
3 Odpovědi
18147 Zobrazení
Avatar
Linto

Hi,
I have created a popup window in pos. When I click on the payment method a popup window will be shown with a textarea.
But the issue is, I am unable to input any value to the textarea using the keyboard. 
I can input value to the text area using 'ctrl+v' , but no other keys in the keyboard is working.
The code I used is below,

this.gui.show_popup('textarea',{
'title': _t('Swipe your card'),
'confirm': function(value) {
        //-------- my code--------------- } });

Any help appreciated. 

Thank you.

0
Avatar
Zrušit
Avatar
Linto
Autor Nejlepší odpověď

Hi Saravana,

I found a solution for this. The reason why it is not possible to input any value is, there is a keyboard key down handler function in 'PaymentScreenWidget'. This is a keydown handler that prevents backspace from doing a back navigation. It also makes sure that keys that do not generate a keypress in Chrom{e,ium} (eg. delete, backspace, ...) get passed to the keypress handler.

I have made some changes in that function and now I can input values using my keyboard.

2
Avatar
Zrušit
Avatar
Boniface Irungu
Nejlepší odpověď

Hi

POS functions keyboard_keydown_handler() and keyboard_handler() blocks typing of content using your keyboard with the pop-up window. To fix this ;

Create  your pos_custom.js file and override the functions from the PaymentScreenWidget. See below code

odoo.define('pos_custom', function (require) {
"use strict";
//
var core = require('web.core');
var utils = require('web.utils');
//
var module = require('point_of_sale.models'); //Includes all Base Classes of point of sale
var round_di = utils.round_decimals;
var round_pr = utils.round_precision;
//Screens
var screens = require('point_of_sale.screens') // Require Base screens class
//
var QWeb = core.qweb;
var _t = core._t;
//
  //Extend payment screen and add more functionality
 screens.PaymentScreenWidget.include({

click_paymentmethods: function(id) {
var self = this ;
var cashregister = null;
for ( var i = 0; i < this.pos.cashregisters.length; i++ ) {
if ( this.pos.cashregisters[i].journal_id[0] === id ){
cashregister = this.pos.cashregisters[i];
break;
}
}
//debug
console.log("Payment Register ID >> " +cashregister.journal.id) ;
console.log("Payment Register Type >>> "+cashregister.journal.payment_mode) ;
//
if(cashregister.journal.payment_mode === 'mpesa'){
var phone_no = '123456' ;
// alert("Enter Client Phone Number >> ") ;
self.gui.show_popup('textinput',{
title: _t("Enter Client Phone Number") ,
confirm: function(){
//get value
var value = this.$('#text-input').val();
//alert(value);
//console.log("Value Captured ",value);
if(value){
console.log("Perform Validation of MPESA Code") ;
//Add Payment Line after success validation of the code
self.pos.get_order().add_paymentline( cashregister );
self.reset_input();
self.render_paymentlines();
}else{
// console.log("Cannot validate Code..");
self.gui.show_popup('error',{
'title': _t('Error: Payment Validation Error'),
'body': _t('Sorry Cannot validate the payment. Try again later'),
});
}

},
}) ;
}else {
//Add Payment Line after success validation of the code
self.pos.get_order().add_paymentline( cashregister );
self.reset_input();
self.render_paymentlines();
}

},
init: function(parent, options) {
var self = this;
this._super(parent, options);
//Overide methods
this.keyboard_keydown_handler = function(event){

if (event.keyCode === 8 || event.keyCode === 46) { // Backspace and Delete
event.preventDefault();
self.keyboard_handler(event);
}
};

this.keyboard_handler = function(event){
var key = '';

if (event.type === "keypress") {
if (event.keyCode === 13) { // Enter
self.validate_order();
} else if ( event.keyCode === 190 || // Dot
event.keyCode === 110 || // Decimal point (numpad)
event.keyCode === 188 || // Comma
event.keyCode === 46 ) { // Numpad dot
key = self.decimal_point;
} else if (event.keyCode >= 48 && event.keyCode <= 57) { // Numbers
key = '' + (event.keyCode - 48);
} else if (event.keyCode === 45) { // Minus
key = '-';
} else if (event.keyCode === 43) { // Plus
key = '+';
}else{
return ;
}
} else { // keyup/keydown
if (event.keyCode === 46) { // Delete
key = 'CLEAR';
} else if (event.keyCode === 8) { // Backspace
key = 'BACKSPACE';
}
}

self.payment_input(key);
// event.preventDefault();
/* if (event.type === "keypress") {
return ;
}*/
};
//End method override
} ,

}) ;

});



Thanks..



0
Avatar
Zrušit
Avatar
Saravana Kumar
Nejlepší odpověď

I too have the same problem in odoo v9.

I created a new payment method for card payment. when choosing this payment option, a popup will arise to get the card details from the user. here i can't key in the details in the input fields. ( ctrl+v is working ).

i tested the odoo base popup widgets like TextInputPopupWidget and TextIAreaPopupWidget both are not working and can't key in the values.

Any solutions.?

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
How to reload orderlines when changing customer in POS Vyřešeno
javascript pos odoo10
Avatar
Avatar
1
čvc 19
10608
TypeError: cur is undefined Odoo 11 Pos
javascript pos odoo odoo10
Avatar
0
pro 18
3572
How to change Odoo POS URL in button click in POS
javascript pos controller odoo10
Avatar
Avatar
1
říj 18
7056
does odoo 17 allow to add button to Navbar header in point of sale session inside it to get dynamic data
javascript pos
Avatar
Avatar
1
lis 24
2273
How to add product in POS programmatically Vyřešeno
javascript pos
Avatar
Avatar
Avatar
Avatar
4
říj 24
5275
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