Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Producție
    • Textile
    • Metal
    • Furnitures
    • Food
    • 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
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Popup window in pos

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
javascriptposodoo10
3 Răspunsuri
18050 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Linto
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Boniface Irungu
Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Saravana Kumar
Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
How to reload orderlines when changing customer in POS Rezolvat
javascript pos odoo10
Imagine profil
Imagine profil
1
iul. 19
10530
TypeError: cur is undefined Odoo 11 Pos
javascript pos odoo odoo10
Imagine profil
0
dec. 18
3483
How to change Odoo POS URL in button click in POS
javascript pos controller odoo10
Imagine profil
Imagine profil
1
oct. 18
6989
does odoo 17 allow to add button to Navbar header in point of sale session inside it to get dynamic data
javascript pos
Imagine profil
Imagine profil
1
nov. 24
2211
How to add product in POS programmatically Rezolvat
javascript pos
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
oct. 24
5207
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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