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
  • Industries
    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
    Výroba
    • 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
  • 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
  • Help

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 store and add a field in pos product screen odoo 15

Odoberať

Get notified when there's activity on this post

This question has been flagged
NiyasCybrosysv15odoomate
2 Replies
3911 Zobrazenia
Avatar
waheed

I want to add button on pos product screen in pos when clicked on the button show number popup while enter number the number should be store on the button label .
created a char field in pos.order the entered number save on that char field.
i wrote i piece of code 
js file:

odoo.define('xy_pos_button.CreateCustomButton', function (require) {
'use strict';

console.log("JS File Loaded");

const { Gui } = require('point_of_sale.Gui');
const PosComponent = require('point_of_sale.PosComponent');
const { posbus } = require('point_of_sale.utils');
const ProductScreen = require('point_of_sale.ProductScreen');
const { useListener } = require('web.custom_hooks');
const Registries = require('point_of_sale.Registries');
const PaymentScreen = require('point_of_sale.PaymentScreen');

class CustomButton extends PosComponent {
constructor() {
super(...arguments);
useListener('click', this.onClick);
}

get ref_order() {
console.log(this.env.pos.get_order(), 'GET POS ORDER');
return this.env.pos.get_order();
}

async onClick() {
const { confirmed, payload: inputNumber } = await this.showPopup('NumberPopup', {
startingValue: this.ref_order,
cheap: true,
isInputSelected: true
});

if (confirmed) {
const delivery_ref_count = parseInt(inputNumber, 10);
const max_capacity = 2 ** 31 - 1;
if (delivery_ref_count > max_capacity) {
await this.showPopup('ErrorPopup', {
title: this.env._t('Blocked action'),
body: _.str.sprintf(
this.env._t('You cannot put a number that exceeds %s '),
max_capacity,
),
});
return;
}
this.env.pos.get_order().set_pos_delivery_order(delivery_ref_count);
}
}
}

CustomButton.template = 'CustomButton';

ProductScreen.addControlButton({
component: CustomButton,
});

Registries.Component.add(CustomButton);

return CustomButton;
});

an other js file

odoo.define('xy_pos_button.popup_note', function (require) {
"use strict";
console.log('POPUP Note Loaded');
var models = require('point_of_sale.models');
const { Gui } = require('point_of_sale.Gui');
const { posbus } = require('point_of_sale.utils');
var _super_order = models.Order.prototype;

models.Order = models.Order.extend({
initialize: function (attr, options) {
_super_order.initialize.apply(this, arguments);
this.pos_delivery_order = this.pos_delivery_order || 1;
this.save_to_db();
},
init: function (parent, options) {
this._super(parent, options);
this.pos.bind('change:selectedOrder', this, this.renderElement);
},
export_as_JSON: function () {
var json = _super_order.export_as_JSON.apply(this, arguments);
json.pos_delivery_order = this.pos_delivery_order;
return json;
},
init_from_JSON: function (json) {
_super_order.init_from_JSON.apply(this, arguments);
this.pos_delivery_order = json.pos_delivery_order || 1;
},
get_pos_delivery_order: function () {
return this.pos_delivery_order;
},
set_pos_delivery_order: function (count) {
this.pos_delivery_order = Math.max(count, 0);
this.trigger('change');
},
});
});

but is does not work
xml







CustomButton



Advance Thanks 

0
Avatar
Zrušiť
Avatar
Jainesh Shah(Aktiv Software)
Best Answer

Hey Waheed,


I hope you are doing well.


I'd like to provide you with some screenshots:

Thanks & Regards,
Email:   odoo@aktivsoftware.com    

Skype: kalpeshmaheshwari

0
Avatar
Zrušiť
waheed
Autor

the above code does not work

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

You can refer to the following links  :


Refer to this blog: https://www.cybrosys.com/blog/how-to-add-custom-screens-in-odoo-15-pos

Videos: https://www.youtube.com/watch?v=QEcow8JNMLQ


Hope it helps

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
Related Posts Replies Zobrazenia Aktivita
Why I am getting error about Max entries
Cybrosys v15 odoomate
Avatar
Avatar
1
feb 24
2314
PLM Confirm Component Not working without Administrator Settings in Odoo 15, AccessError: Sorry, you are not allowed to access this document.
Niyas Cybrosys niyas odoomate
Avatar
0
dec 23
1879
How to Show On Hand Quantity on POS screen in Odoo-15
pos Niyas Cybrosys v15
Avatar
Avatar
1
okt 23
2170
Create Auto Bill From Picking in Odoo15 Solved
stock_picking Niyas Cybrosys v15
Avatar
Avatar
2
sep 23
2280
Odoo database expiration message show again and again Solved
Cybrosys v15
Avatar
Avatar
Avatar
3
dec 24
6890
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