Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • 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
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

how to add a cust how to add a button to do the same action as validate button and redirect to my personalized receiptom button for print receip

Odoberať

Get notified when there's activity on this post

This question has been flagged
2022 Zobrazenia
Avatar
John Poma

I added a button on the pos payment interface which shows me a popup. how to make that when the user clicks on the confirm button of this popup that it redirects to the receipt of the pos

This is my action_button.js code:

"use strict";
var core = require('web.core');
var models = require('point_of_sale.models');
var screens = require('point_of_sale.screens');
var gui = require('point_of_sale.gui');
var PopupWidget = require('point_of_sale.popups');
var PaymentScreenWidget = screens.PaymentScreenWidget;
var PosBaseWidget = require('point_of_sale.BaseWidget');
var BarcodeEvents = require('barcodes.BarcodeEvents').BarcodeEvents;
var time = require('web.time');
var QWeb = core.qweb;
var ajax = require('web.ajax');
var _t = core._t;

var PopupNote = PopupWidget.extend({
template: 'PopupNote',
show: function(options) {
options = options || {};
this._super(options);
this.renderElement();
},
click_confirm: function() {
var value = this.$('input,textarea').val();
this.gui.close_popup();

if (this.options.confirm) {
this.options.confirm.call(this, value);
}
},
});
gui.define_popup({ name: 'popup_note', widget: PopupNote });
PaymentScreenWidget.include({
init: function(parent, options) {
var self = this;
this._super(parent, options);

this.pos.bind('change:selectedOrder', function() {
this.renderElement();
this.watch_order_changes();
}, this);
this.watch_order_changes();

this.inputbuffer = "";
this.firstinput = true;
this.decimal_point = _t.database.parameters.decimal_point;

// 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.
this.keyboard_keydown_handler = function(event) {
if (event.keyCode === 8 || event.keyCode === 46) { // Backspace and Delete
// event.preventDefault();

// These do not generate keypress events in
// Chrom{e,ium}. Even if they did, we just called
// preventDefault which will cancel any keypress that
// would normally follow. So we call keyboard_handler
// explicitly with this keydown event.
self.keyboard_handler(event);
}
};

// This keyboard handler listens for keypress events. It is
// also called explicitly to handle some keydown events that
// do not generate keypress events.
this.keyboard_handler = function(event) {
// On mobile Chrome BarcodeEvents relies on an invisible
// input being filled by a barcode device. Let events go
// through when this input is focused.
if (BarcodeEvents.$barcodeInput && BarcodeEvents.$barcodeInput.is(":focus")) {
return;
}

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 { // keyup/keydown
if (event.keyCode === 46) { // Delete
key = 'CLEAR';
} else if (event.keyCode === 8) { // Backspace
key = 'BACKSPACE';
}
}

// self.payment_input(key);
// event.preventDefault();
};

this.pos.bind('change:selectedClient', function() {
self.customer_changed();
}, this);
},
renderElement: function() {
var self = this;
this._super();

//var methods = this.render_paymentmethods();
//methods.appendTo(this.$('.paymentmethods-container'));
this.$('.confirm').click(function(){
self.click_custom_print();
});
this.$('.back').click(function(){
self.click_back();
});
/* this.$('.next').click(function(){
self.validate_order();
});*/
// console.log(this.$('js_customer_name'))
this.$('.popup_notes').click(function() {
self.get_select_data();
});
},
click_custom_print: function(){
var order = this.pos.get_order();
console.log(order)
// Render receipt screen and can print function
},
validate_order: function(force_validation) {
console.log("validation here")
if (this.order_is_valid(force_validation)) {
this.finalize_validation();
}
},
get_select_data: function() {
var self = this;
self.gui.show_popup('popup_note', {
title: _t('Interface Mobile money'),
confirm: function() {
var order = self.pos.get_order();
console.log("order=")
console.log(order)
var client_name=$("#client_name").text()
var numero_agent=$("#numero_agent").text()
var ref=document.getElementsByName("ref")[0].value
var montant=document.getElementsByName("montant")[0].value

if( numero_agent != '' && ref != '' && montant != ''){
ajax.jsonRpc("http://localhost:8070/postmobilemoney/",'call',{
name:"test",
reference:ref,
montant:montant,
nom_client:client_name,
numero_agent:numero_agent,
}).then(function (result){
var reference = result["reference"]
console.log(result)
//window.location.replace("http://localhost:8070/command/getall/"+reference);
})
}else {
alert("veuillez remplir tous les champs")
}
},
cance: function() {},
});
},

My views\pos.xml code in it we also find the popup interface: 








































Customer





Confirm


Cancel






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

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

Registrácia
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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